home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-bgp-bgp4-04.txt < prev    next >
Text File  |  1993-03-03  |  130KB  |  3,194 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                                      Y. Rekhter
  6. Request for Comments: DRAFT    T.J. Watson Research Center, IBM Corp.
  7.                                                                  T.Li
  8.                                                         cisco Systems
  9.                                                               Editors
  10.                                                         December 1992
  11.  
  12.  
  13.                   A Border Gateway Protocol 4 (BGP-4)
  14.  
  15.  
  16. Status of this Memo
  17.  
  18.    This document, together with its companion document, "Application of
  19.    the Border Gateway Protocol in the Internet", define an inter-
  20.    autonomous system routing protocol for the Internet. This RFC
  21.    specifies an IAB standards track protocol for the Internet community,
  22.    and requests discussion and suggestions for improvements.  Please
  23.    refer to the current edition of the "IAB Official Protocol Standards"
  24.    for the standardization state and status of this protocol.
  25.    Distribution of this document is unlimited.
  26.  
  27.    This document is an Internet Draft. Internet Drafts are working
  28.    documents of the Internet Engineering Task Force (IETF), its Areas,
  29.    and its Working Groups. Note that other groups may also distribute
  30.    working documents as Internet Drafts.
  31.  
  32.    Internet Drafts are draft documents valid for a maximum of six
  33.    months. Internet Drafts may be updated, replaced, or obsoleted by
  34.    other documents at any time. It is not appropriate to use Internet
  35.    Drafts as reference material or to cite them other than as a "working
  36.    draft" or "work in progress".
  37.  
  38.  
  39. 1. Acknowledgements
  40.  
  41.    This document was originally published as RFC 1267 in October 1991,
  42.    jointly authored by Kirk Lougheed (cisco Systems) and Yakov Rekhter
  43.    (IBM).
  44.  
  45.    We would like to express our thanks to Guy Almes (Rice University),
  46.    Len Bosack (cisco Systems), and Jeffrey C. Honig (Cornell University)
  47.    for their contributions to the earlier version of this document.
  48.  
  49.    We like to explicitly thank Bob Braden (ISI) for the review of the
  50.    earlier version of this document as well as his constructive and
  51.    valuable comments.
  52.  
  53.  
  54.  
  55.  
  56. Expiration Date May 1993                                        [Page 1]
  57.  
  58. RFC DRAFT                                                  December 1992
  59.  
  60.  
  61.    We would also like to thank Bob Hinden, Director for Routing of the
  62.    Internet Engineering Steering Group, and the team of reviewers he
  63.    assembled to review earlier versions of this document.  This team,
  64.    consisting of Deborah Estrin, Milo Medin, John Moy, Radia Perlman,
  65.    Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted with a
  66.    strong combination of toughness, professionalism, and courtesy.
  67.  
  68.    This updated version of the document is the product of the IETF BGP
  69.    Working Group with Yakov Rekhter and Tony Li as editors. Certain
  70.    sections of the document borrowed heavily from IDRP [7], which is the
  71.    OSI counterpart of BGP. For this credit should be given to the ANSI
  72.    X3S3.3 group chaired by Lyman Chapin (BBN) and to Charles Kunzinger
  73.    (IBM Corp.) who is the IDRP editor within that group.  We would also
  74.    like to thank Mike Craren (Proteon, Inc.), Dimitry Haskin (BBN) and
  75.    Dennis Ferguson (University of Toronto) for their insightful
  76.    comments.
  77.  
  78.  
  79. 2.  Introduction
  80.  
  81.    The Border Gateway Protocol (BGP) is an inter-Autonomous System
  82.    routing protocol.  It is built on experience gained with EGP as
  83.    defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as
  84.    described in RFC 1092 [2] and RFC 1093 [3].
  85.  
  86.    The primary function of a BGP speaking system is to exchange network
  87.    reachability information with other BGP systems.  This network
  88.    reachability information includes information on the list of
  89.    Autonomous Systems (ASs) that reachability information traverses.
  90.    This information is sufficient to construct a graph of AS
  91.    connectivity from which routing loops may be pruned and some policy
  92.    decisions at the AS level may be enforced.
  93.  
  94.    BGP-4 provides a new set of mechanisms for supporting classless
  95.    interdomain routing.  These mechanisms include support for
  96.    advertising an IP prefix and eliminates the concept of network
  97.    "class" within BGP.  BGP-4 also introduces mechanisms which allow
  98.    aggregation of routes, including aggregation of AS paths.  These
  99.    changes provide support for the proposed supernetting scheme [8].
  100.  
  101.    To characterize the set of policy decisions that can be enforced
  102.    using BGP, one must focus on the rule that a BGP speaker  advertise
  103.    to its peer in neighbor ASs only those routes that it itself uses.
  104.    This rule reflects the "hop-by-hop" routing paradigm generally used
  105.    throughout the current Internet.  Note that some policies cannot be
  106.    supported by the "hop-by-hop" routing paradigm and thus require
  107.    techniques such as source routing to enforce.  For example, BGP does
  108.    not enable one AS to send traffic to a neighboring AS intending that
  109.  
  110.  
  111.  
  112. Expiration Date May 1993                                        [Page 2]
  113.  
  114. RFC DRAFT                                                  December 1992
  115.  
  116.  
  117.    the traffic take a different route from that taken by traffic
  118.    originating in the neighboring AS.  On the other hand, BGP can
  119.    support any policy conforming to the "hop-by-hop" routing paradigm.
  120.    Since the current Internet uses only the "hop-by-hop" routing
  121.    paradigm and since BGP can support any policy that conforms to that
  122.    paradigm, BGP is highly applicable as an inter-AS routing protocol
  123.    for the current Internet.
  124.  
  125.    A more complete discussion of what policies can and cannot be
  126.    enforced with BGP is outside the scope of this document (but refer to
  127.    the companion document discussing BGP usage [5]).
  128.  
  129.    BGP runs over a reliable transport protocol.  This eliminates the
  130.    need to implement explicit update fragmentation, retransmission,
  131.    acknowledgement, and sequencing.  Any authentication scheme used by
  132.    the transport protocol may be used in addition to BGP's own
  133.    authentication mechanisms.  The error notification mechanism used in
  134.    BGP assumes that the transport protocol supports a "graceful" close,
  135.    i.e., that all outstanding data will be delivered before the
  136.    connection is closed.
  137.  
  138.    BGP uses TCP [4] as its transport protocol.  TCP meets BGP's
  139.    transport requirements and is present in virtually all commercial
  140.    routers and hosts.  In the following descriptions the phrase
  141.    "transport protocol connection" can be understood to refer to a TCP
  142.    connection.  BGP uses TCP port 179 for establishing its connections.
  143.  
  144.    This memo uses the term `Autonomous System' (AS) throughout.  The
  145.    classic definition of an Autonomous System is a set of routers under
  146.    a single technical administration, using an interior gateway protocol
  147.    and common metrics to route packets within the AS, and using an
  148.    exterior gateway protocol to route packets to other ASs.  Since this
  149.    classic definition was developed, it has become common for a single
  150.    AS to use several interior gateway protocols and sometimes several
  151.    sets of metrics within an AS.  The use of the term Autonomous System
  152.    here stresses the fact that, even when multiple IGPs and metrics are
  153.    used, the administration of an AS appears to other ASs to have a
  154.    single coherent interior routing plan and presents a consistent
  155.    picture of what networks are reachable through it.
  156.  
  157.    The planned use of BGP in the Internet environment, including such
  158.    issues as topology, the interaction between BGP and IGPs, and the
  159.    enforcement of routing policy rules is presented in a companion
  160.    document [5].  This document is the first of a series of documents
  161.    planned to explore various aspects of BGP application.  Please send
  162.    comments to the BGP mailing list (iwg@rice.edu).
  163.  
  164.  
  165.  
  166.  
  167.  
  168. Expiration Date May 1993                                        [Page 3]
  169.  
  170. RFC DRAFT                                                  December 1992
  171.  
  172.  
  173. 3.  Summary of Operation
  174.  
  175.    Two systems form a transport protocol connection between one another.
  176.    They exchange messages to open and confirm the connection parameters.
  177.    The initial data flow is the entire BGP routing table.  Incremental
  178.    updates are sent as the routing tables change.  BGP does not require
  179.    periodic refresh of the entire BGP routing table.  Therefore, a BGP
  180.    speaker must retain the current version of the entire BGP routing
  181.    tables of all of its peers for the duration of the connection.
  182.    KeepAlive messages are sent periodically to ensure the liveness of
  183.    the connection.  Notification messages are sent in response to errors
  184.    or special conditions.  If a connection encounters an error
  185.    condition, a notification message is sent and the connection is
  186.    closed.
  187.  
  188.    The hosts executing the Border Gateway Protocol need not be routers.
  189.    A non-routing host could exchange routing information with routers
  190.    via EGP or even an interior routing protocol.  That non-routing host
  191.    could then use BGP to exchange routing information with a border
  192.    router in another Autonomous System.  The implications and
  193.    applications of this architecture are for further study.
  194.  
  195.    If a particular AS has multiple BGP speakers and is providing transit
  196.    service for other ASs, then care must be taken to ensure a consistent
  197.    view of routing within the AS.  A consistent view of the interior
  198.    routes of the AS is provided by the interior routing protocol.  A
  199.    consistent view of the routes exterior to the AS can be provided by
  200.    having all BGP speakers within the AS maintain direct BGP connections
  201.    with each other.  Using a common set of policies, the BGP speakers
  202.    arrive at an agreement as to which border routers will serve as
  203.    exit/entry points for particular networks outside the AS.  This
  204.    information is communicated to the AS's internal routers, possibly
  205.    via the interior routing protocol.  Care must be taken to ensure that
  206.    the interior routers have all been updated with transit information
  207.    before the BGP speakers announce to other ASs that transit service is
  208.    being provided.
  209.  
  210.    Connections between BGP speakers of different ASs are referred to as
  211.    "external" links.  BGP connections between BGP speakers within the
  212.    same AS are referred to as "internal" links.
  213.  
  214. 3.1 Routes: Advertisement and Storage
  215.  
  216.    For purposes of this protocol a route is defined as a unit of
  217.    information that pairs a destination with the attributes of a path to
  218.    that destination:
  219.  
  220.       - Routes are advertised between a pair of BGP speakers in UPDATE
  221.  
  222.  
  223.  
  224. Expiration Date May 1993                                        [Page 4]
  225.  
  226. RFC DRAFT                                                  December 1992
  227.  
  228.  
  229.       messages:  the destination is the systems whose IP addresses are
  230.       reported in the Network Layer Reachability Information (NLRI)
  231.       field, and the the path is the information reported in the path
  232.       attributes fields of the same UPDATE message.
  233.  
  234.  
  235.       - Routes are stored in the Routing Information Bases (RIBs):
  236.       namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes
  237.       that will be advertised to other BGP speakers must be present in
  238.       the Adj-RIB-Out; routes that will be used by the local BGP speaker
  239.       must be present in the Loc-RIB, and the next hop for each of these
  240.       routes must be present in the local BGP speaker's forwarding
  241.       information base; and routes that are received from other BGP
  242.       speakers are present in the Adj-RIBs-In.
  243.  
  244.  
  245.    If a BGP speaker chooses to advertise the route, it may add to or
  246.    modify the path attributes of the route before advertising it to
  247.    adjacent BGP speaker.
  248.  
  249.    BGP provides mechanisms by which a BGP speaker can inform its
  250.    neighbor that a previously advertised route is no longer available
  251.    for use.  There are three methods by which a given BGP speaker can
  252.    indicate that a route has been withdrawn from service:
  253.  
  254.  
  255.       a) the IP prefix that expresses destinations for a previously
  256.       advertised route can be advertised in the WITHDRAWN ROUTES field
  257.       in the UPDATE message, thus marking the associated route as being
  258.       no longer available for use
  259.  
  260.       b) a replacement route with the same Network Layer Reachability
  261.       Information can be advertised, or
  262.  
  263.       c) the BGP speaker - BGP speaker connection can be closed, which
  264.       implicitly removes from service all routes which the pair of
  265.       speakers had advertised to each other.
  266.  
  267.  
  268. 3.2 Routing Information Bases
  269.  
  270.    The Routing Information Base (RIB) within a BGP speaker consists of
  271.    three distinct parts:
  272.  
  273.       a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has
  274.       been learned from inbound UPDATE messages. Their contents
  275.       represent routes that are available as an input to the Decision
  276.       Process.
  277.  
  278.  
  279.  
  280. Expiration Date May 1993                                        [Page 5]
  281.  
  282. RFC DRAFT                                                  December 1992
  283.  
  284.  
  285.       b) Loc-RIB: The Loc-RIB contains the local routing information
  286.       that the BGP speaker has selected by applying its local policies
  287.       to the routing information contained in its Adj-RIBs-In.
  288.  
  289.       c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the
  290.       local BGP speaker has selected for advertisement to its neighbors.
  291.       The routing information stored in the Adj-RIBs-Out will be carried
  292.       in the local BGP speaker's UPDATE messages and advertised to its
  293.       neighbor BGP speakers.
  294.  
  295.  
  296.    In summary, the Adj-RIBs-In contain unprocessed routing information
  297.    that has been advertised to the local BGP speaker by its neighbors;
  298.    the Loc-RIB contains the routes that have been selected by the local
  299.    BGP speaker's Decision Process; and the Adj-RIBs-Out organize the
  300.    routes for advertisement to specific neighbor BGP speakers by means
  301.    of the local speaker's UPDATE messages.
  302.  
  303.    Although the conceptual model distinguishes between Adj-RIBs-In,
  304.    Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an
  305.    implementation must maintain three separate copies of the routing
  306.    information. The choice of implementation (for example, 3 copies of
  307.    the information vs 1 copy with pointers) is not constrained by the
  308.    protocol.
  309.  
  310. 4.  Message Formats
  311.  
  312.    This section describes message formats used by BGP.
  313.  
  314.    Messages are sent over a reliable transport protocol connection.  A
  315.    message is processed only after it is entirely received.  The maximum
  316.    message size is 4096 octets.  All implementations are required to
  317.    support this maximum message size.  The smallest message that may be
  318.    sent consists of a BGP header without a data portion, or 19 octets.
  319.  
  320.  
  321. 4.1 Message Header Format
  322.  
  323.  
  324.    Each message has a fixed-size header.  There may or may not be a data
  325.    portion following the header, depending on the message type.  The
  326.    layout of these fields is shown below:
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. Expiration Date May 1993                                        [Page 6]
  337.  
  338. RFC DRAFT                                                  December 1992
  339.  
  340.  
  341.        0                   1                   2                   3
  342.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  343.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  344.       |                                                               |
  345.       +                                                               +
  346.       |                                                               |
  347.       +                                                               +
  348.       |                           Marker                              |
  349.       +                                                               +
  350.       |                                                               |
  351.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  352.       |          Length               |      Type     |
  353.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  354.  
  355.  
  356.       Marker:
  357.  
  358.          This 16-octet field contains a value that the receiver of the
  359.          message can predict.  If the Type of the message is OPEN, or if
  360.          the Authentication Code used in the OPEN message of the
  361.          connection is zero, then the Marker must be all ones.
  362.          Otherwise, the value of the marker can be predicted by some a
  363.          computation specified as part of the authentication mechanism
  364.          used.  The Marker can be used to detect loss of synchronization
  365.          between a pair of BGP peers, and to authenticate incoming BGP
  366.          messages.
  367.  
  368.  
  369.       Length:
  370.  
  371.          This 2-octet unsigned integer indicates the total length of the
  372.          message, including the header, in octets.  Thus, e.g., it
  373.          allows one to locate in the transport-level stream the (Marker
  374.          field of the) next message.  The value of the Length field must
  375.          always be at least 19 and no greater than 4096, and may be
  376.          further constrained, depending on the message type.  No
  377.          "padding" of extra data after the message is allowed, so the
  378.          Length field must have the smallest value required given the
  379.          rest of the message.
  380.  
  381.       Type:
  382.  
  383.          This 1-octet unsigned integer indicates the type code of the
  384.          message.  The following type codes are defined:
  385.  
  386.                                     1 - OPEN
  387.                                     2 - UPDATE
  388.                                     3 - NOTIFICATION
  389.  
  390.  
  391.  
  392. Expiration Date May 1993                                        [Page 7]
  393.  
  394. RFC DRAFT                                                  December 1992
  395.  
  396.  
  397.                                     4 - KEEPALIVE
  398.  
  399.  
  400. 4.2 OPEN Message Format
  401.  
  402.  
  403.    After a transport protocol connection is established, the first
  404.    message sent by each side is an OPEN message.  If the OPEN message is
  405.    acceptable, a KEEPALIVE message confirming the OPEN is sent back.
  406.    Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION
  407.    messages may be exchanged.
  408.  
  409.    In addition to the fixed-size BGP header, the OPEN message contains
  410.    the following fields:
  411.  
  412.  
  413.  
  414.  
  415.         0                   1                   2                   3
  416.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  417.        +-+-+-+-+-+-+-+-+
  418.        |    Version    |
  419.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  420.        |     My Autonomous System      |
  421.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  422.        |           Hold Time           |
  423.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  424.        |                         BGP Identifier                        |
  425.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  426.        |  Auth. Code   |
  427.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  428.        |                                                               |
  429.        |                       Authentication Data                     |
  430.        |                                                               |
  431.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  432.  
  433.  
  434.  
  435.       Version:
  436.  
  437.          This 1-octet unsigned integer indicates the protocol version
  438.          number of the message.  The current BGP version number is 4.
  439.  
  440.       My Autonomous System:
  441.  
  442.          This 2-octet unsigned integer indicates the Autonomous System
  443.          number of the sender.
  444.  
  445.  
  446.  
  447.  
  448. Expiration Date May 1993                                        [Page 8]
  449.  
  450. RFC DRAFT                                                  December 1992
  451.  
  452.  
  453.       Hold Time:
  454.  
  455.          This 2-octet unsigned integer indicates the maximum number of
  456.          seconds that may elapse between the receipt of successive
  457.          KEEPALIVE and/or UPDATE and/or NOTIFICATION messages by the sender,
  458.          before the sender will declare the receiver as down.
  459.  
  460.  
  461.       BGP Identifier:
  462.          This 4-octet unsigned integer indicates the BGP Identifier of
  463.          the sender. A given BGP speaker sets the value of its BGP
  464.          Identifier to an IP address assigned to that BGP speaker.
  465.          The value of the BGP Identifier is determined on startup
  466.          and is the same for every local interface and every BGP peer.
  467.  
  468.       Authentication Code:
  469.  
  470.          This 1-octet unsigned integer indicates the authentication
  471.          mechanism being used.  Whenever an authentication mechanism is
  472.          specified for use within BGP, three things must be included in the
  473.          specification:
  474.          - the value of the Authentication Code which indicates use of
  475.          the mechanism,
  476.          - the form and meaning of the Authentication Data, and
  477.          - the algorithm for computing values of Marker fields.
  478.          Only one authentication mechanism is specified as part of this
  479.          memo:
  480.          - its Authentication Code is zero,
  481.          - its Authentication Data must be empty (of zero length), and
  482.          - the Marker fields of all messages must be all ones.
  483.          The semantics of non-zero Authentication Codes lies outside the
  484.          scope of this memo.
  485.  
  486.          Note that a separate authentication mechanism may be used in
  487.          establishing the transport level connection.
  488.  
  489.       Authentication Data:
  490.  
  491.          The form and meaning of this field is a variable-length field
  492.          depend on the Authentication Code.  If the value of Authentication
  493.          Code field is zero, the Authentication Data field must have zero
  494.          length.  The semantics of the non-zero length Authentication Data
  495.          field is outside the scope of this memo.
  496.  
  497.          Note that the length of the Authentication Data field can be
  498.          determined from the message Length field by the formula:
  499.  
  500.             Message Length = 29 + Authentication Data Length
  501.  
  502.  
  503.  
  504. Expiration Date May 1993                                        [Page 9]
  505.  
  506. RFC DRAFT                                                  December 1992
  507.  
  508.  
  509.  
  510.          The minimum length of the OPEN message is 29 octets (including
  511.          message header).
  512.  
  513.  
  514. 4.3 UPDATE Message Format
  515.  
  516.  
  517.    UPDATE messages are used to transfer routing information between BGP
  518.    peers.  The information in the UPDATE packet can be used to construct
  519.    a graph describing the relationships of the various Autonomous
  520.    Systems.  By applying rules to be discussed, routing information
  521.    loops and some other anomalies may be detected and removed from
  522.    inter-AS routing.
  523.  
  524.    An UPDATE message is used advertise a single feasible route to a
  525.    neighboring BGP speaker, or to withdraw multiple unfeasible routes
  526.    from service (see 3.1). An UPDATE message may simultaneously advertise
  527.    a feasible route and withdraw multiple unfeasible routes from service.
  528.    The UPDATE message always includes the fixed-size BGP header,
  529.    and can optionally include the other fields as shown below:
  530.  
  531.  
  532.       +-----------------------------------------------------+
  533.       |   Unfeasible Routes Length (2 octets)               |
  534.       +-----------------------------------------------------+
  535.       |  Withdrawn Routes (variable)                        |
  536.       +-----------------------------------------------------+
  537.       |   Total Path Attribute Length (2 octets)            |
  538.       +-----------------------------------------------------+
  539.       |    Path Attributes (variable)                       |
  540.       +-----------------------------------------------------+
  541.       |   Network Layer Reachability Information (variable) |
  542.       +-----------------------------------------------------+
  543.  
  544.  
  545.  
  546.       Unfeasible Routes Length:
  547.  
  548.          This 2-octets unsigned integer indicates the total length of
  549.          the Withdrawn Routes field in octets.  Its value must allow the
  550.          length of the Network Layer Reachability Information field to
  551.          be determined as specified below.
  552.  
  553.          A value of 0 indicates that no routes are being withdrawn from
  554.          service, and that the WITHDRAWN ROUTES field is not present in
  555.          this UPDATE message.
  556.  
  557.  
  558.  
  559.  
  560. Expiration Date May 1993                                       [Page 10]
  561.  
  562. RFC DRAFT                                                  December 1992
  563.  
  564.  
  565.       Withdrawn Routes:
  566.  
  567.  
  568.          This is a variable length field that contains a list of IP
  569.          address prefixes for the routes that are being withdrawn from
  570.          service.  Each IP address prefix is encoded as a 2-tuple of the
  571.          form <length, prefix>, whose fields are described below:
  572.  
  573.                   +---------------------------+
  574.                   |   Length (1 octet)        |
  575.                   +---------------------------+
  576.                   |   Prefix (variable)       |
  577.                   +---------------------------+
  578.  
  579.  
  580.          The use and the meaning of these fields are as follows:
  581.  
  582.          a) Length:
  583.  
  584.             The Length field indicates the length in bits of the IP
  585.             address prefix. A length of zero indicates a prefix that
  586.             matches all IP addresses (with prefix, itself, of zero
  587.             octets).
  588.  
  589.          b) Prefix:
  590.  
  591.             The Prefix field contains IP address prefixes followed by
  592.             enough trailing bits to make the end of the field fall on an
  593.             octet boundary. Note that the value of trailing bits is
  594.             irrelevant.
  595.  
  596.       Total Path Attribute Length:
  597.  
  598.          This 2-octet unsigned integer indicates the total length of the
  599.          Path Attributes field in octets.  Its value must allow the
  600.          length of the Network Layer Reachability field to be determined
  601.          as specified below.
  602.  
  603.          A value of 0 indicates that no Network Layer Reachability
  604.          Information field is present in this UPDATE message.
  605.  
  606.       Path Attributes:
  607.  
  608.          A variable length sequence of path attributes is present in
  609.          every UPDATE.  Each path attribute is a triple <attribute type,
  610.          attribute length, attribute value> of variable length.
  611.  
  612.          Attribute Type is a two-octet field that consists of the
  613.  
  614.  
  615.  
  616. Expiration Date May 1993                                       [Page 11]
  617.  
  618. RFC DRAFT                                                  December 1992
  619.  
  620.  
  621.          Attribute Flags octet followed by the Attribute Type Code
  622.          octet.
  623.  
  624.  
  625.  
  626.  
  627.                 0                   1
  628.                 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  629.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  630.                |  Attr. Flags  |Attr. Type Code|
  631.                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  632.  
  633.  
  634.          The high-order bit (bit 0) of the Attribute Flags octet is the
  635.          Optional bit.  It defines whether the attribute is optional (if
  636.          set to 1) or well-known (if set to 0).
  637.  
  638.          The second high-order bit (bit 1) of the Attribute Flags octet
  639.          is the Transitive bit.  It defines whether an optional
  640.          attribute is transitive (if set to 1) or non-transitive (if set
  641.          to 0).  For well-known attributes, the Transitive bit must be
  642.          set to 1.  (See Section 5 for a discussion of transitive
  643.          attributes.)
  644.  
  645.          The third high-order bit (bit 2) of the Attribute Flags octet
  646.          is the Partial bit.  It defines whether the information
  647.          contained in the optional transitive attribute is partial (if
  648.          set to 1) or complete (if set to 0).  For well-known attributes
  649.          and for optional non-transitive attributes the Partial bit must
  650.          be set to 0.
  651.  
  652.          The fourth high-order bit (bit 3) of the Attribute Flags octet
  653.          is the Extended Length bit.  It defines whether the Attribute
  654.          Length is one octet (if set to 0) or two octets (if set to 1).
  655.          Extended Length may be used only if the length of the attribute
  656.          value is greater than 255 octets.
  657.  
  658.          The lower-order four bits of the Attribute Flags octet are .
  659.          unused. They must be zero (and must be ignored when received).
  660.  
  661.          The Attribute Type Code octet contains the Attribute Type Code.
  662.          Currently defined Attribute Type Codes are discussed in Section
  663.          5.
  664.  
  665.          If the Extended Length bit of the Attribute Flags octet is set
  666.          to 0, the third octet of the Path Attribute contains the length
  667.          of the attribute data in octets.
  668.  
  669.  
  670.  
  671.  
  672. Expiration Date May 1993                                       [Page 12]
  673.  
  674. RFC DRAFT                                                  December 1992
  675.  
  676.  
  677.          If the Extended Length bit of the Attribute Flags octet is set
  678.          to 1, then the third and the fourth octets of the path
  679.          attribute contain the length of the attribute data in octets.
  680.  
  681.          The remaining octets of the Path Attribute represent the
  682.          attribute value and are interpreted according to the Attribute
  683.          Flags and the Attribute Type Code. The supported attribute
  684.          values and their uses are the following:
  685.  
  686.          a)   ORIGIN (Type Code 1):
  687.  
  688.             ORIGIN is a well-known mandatory attribute that defines the
  689.             origin of the path information.   The data octet can assume
  690.             the following values:
  691.  
  692.                   Value      Meaning
  693.  
  694.                   0         IGP - Network Layer Reachability Information
  695.                                is interior to the originating AS
  696.  
  697.                   1         EGP - Network Layer Reachability Information
  698.                                learned via EGP
  699.  
  700.                   2         INCOMPLETE - Network Layer Reachability
  701.                                Information learned by some other means
  702.  
  703.             Its usage is defined in 5.1.1
  704.  
  705.          b) AS_PATH (Type Code 2):
  706.  
  707.             AS_PATH is a well-known mandatory attribute that is composed
  708.             of a sequence of AS path segments. Each AS path segment is
  709.             represented by a triple <path segment type, path segment
  710.             length, path segment value>.
  711.  
  712.             The path segment type is a 1-octet long field with the
  713.             following values defined:
  714.  
  715.                   Value      Segment Type
  716.  
  717.                   1         AS_SET: unordered set of ASs a route in the
  718.                                UPDATE message has traversed
  719.  
  720.                   2         AS_SEQUENCE: ordered set of ASs a route in
  721.                                the UPDATE message has traversed
  722.  
  723.             The path segment length is a 1-octet long field containing
  724.             the number of ASs in the path segment value field.
  725.  
  726.  
  727.  
  728. Expiration Date May 1993                                       [Page 13]
  729.  
  730. RFC DRAFT                                                  December 1992
  731.  
  732.  
  733.             The path segment value field contains one or more AS
  734.             numbers, each encoded as a 2-octets long field.
  735.  
  736.             Usage of this attribute is defined in 5.1.2.
  737.  
  738.          c)   NEXT_HOP (Type Code 3):
  739.  
  740.             This is a well-known mandatory attribute that defines the IP
  741.             address of the border router that should be used as the next
  742.             hop to the destinations listed in the Network Layer
  743.             Reachability field of the UPDATE message.
  744.  
  745.             Usage of this attribute is defined in 5.1.3.
  746.  
  747.  
  748.          d) MULTI_EXIT_DISC (Type Code 4):
  749.  
  750.             This is an optional non-transitive attribute that is a 1
  751.             octet non-negative integer. The value of this attribute may
  752.             be used by a BGP speaker's decision process to discriminate
  753.             between multiple exit points to an adjacent autonomous
  754.             system.
  755.  
  756.             Its usage is defined in 5.1.4.
  757.  
  758.          e) LOCAL_PREF (Type Code 5):
  759.  
  760.             LOCAL_PREF is a well-known discretionary attribute that is a
  761.             1 octet non-negative integer. It is used by a BGP speaker to
  762.             inform other BGP speakers in its own autonomous system of
  763.             the originating speaker's degree of preference for an
  764.             advertised route. Usage of this attribute is described in
  765.             5.1.5.
  766.  
  767.          f) ATOMIC_AGGREGATE (Type Code 6)
  768.  
  769.             ATOMIC_AGGREGATE is a well-known discretionary attribute of
  770.             length 0. It is used by a BGP speaker to inform other BGP
  771.             speakers that the local system selected a less specific
  772.             route without selecting a more specific route which is
  773.             included in it. Usage of this attribute is described in
  774.             5.1.6.
  775.  
  776.          g) AGGREGATOR (Type Code 7)
  777.  
  778.             AGGREGATOR is an optional transitive attribute of length 2.
  779.             It is used by a BGP speaker to to indicate the AS number of
  780.             the last AS that formed the aggregate route.  Usage of this
  781.  
  782.  
  783.  
  784. Expiration Date May 1993                                       [Page 14]
  785.  
  786. RFC DRAFT                                                  December 1992
  787.  
  788.  
  789.             attribute is described in 5.1.7
  790.  
  791.       Network Layer Reachability Information:
  792.  
  793.          This variable length field contains a list of IP address
  794.          prefixes.  The length in octets of the Network Layer
  795.          Reachability Information is not encoded explicitly, but can be
  796.          calculated as:
  797.  
  798.             UPDATE message Length - 23 - Total Path Attributes Length -
  799.             Unfeasible Routes Length
  800.  
  801.          where UPDATE message Length is the value encoded in the fixed-
  802.          size BGP header, Total Path Attribute Length and Unfeasible
  803.          Routes Length  are the values encoded in the variable part of
  804.          the UPDATE message, and 23 is a combined length of the fixed-
  805.          size BGP header, the Total Path Attribute Length field and the
  806.          Unfeasible Routes Length field.
  807.  
  808.          Reachability information is encoded as one or more 2-tuples of
  809.          the form <length, prefix>, whose fields are described below:
  810.  
  811.  
  812.                   +---------------------------+
  813.                   |   Length (1 octet)        |
  814.                   +---------------------------+
  815.                   |   Prefix (variable)       |
  816.                   +---------------------------+
  817.  
  818.  
  819.          The use and the meaning of these fields are as follows:
  820.  
  821.          a) Length:
  822.  
  823.             The Length field indicates the length in bits of the IP
  824.             address prefix. A length of zero indicates a prefix that
  825.             matches all IP addresses (with prefix, itself, of zero
  826.             octets).
  827.  
  828.          b) Prefix:
  829.  
  830.             The Prefix field contains IP address prefixes followed by
  831.             enough trailing bits to make the end of the field fall on an
  832.             octet boundary. Note that the value of the trailing bits is
  833.             irrelevant.
  834.  
  835.    The minimum length of the UPDATE message is 33 octets (including
  836.    message header).
  837.  
  838.  
  839.  
  840. Expiration Date May 1993                                       [Page 15]
  841.  
  842. RFC DRAFT                                                  December 1992
  843.  
  844.  
  845.    An UPDATE message can advertise at most one route, which may be
  846.    described by several path attributes. All path attributes contained
  847.    in a given UPDATE messages apply to the destinations carried in the
  848.    Network Layer Reachability Information field of the UPDATE message.
  849.  
  850.    An UPDATE message can list multiple routes to be withdrawn from
  851.    service.  Each such route is identified by its destination (expressed
  852.    as an IP prefix), which unambiguously identifies the route in the
  853.    context of the BGP speaker - BGP speaker connection to which it has
  854.    been previously been advertised.
  855.  
  856.    An UPDATE message may advertise only routes to be withdrawn from
  857.    service, in which case it will not include path attributes or Network
  858.    Layer Reachability Information. Conversely, it may advertise only a
  859.    feasible route, in which case the WITHDRAWN ROUTES field need not be
  860.    present.
  861.  
  862.  
  863. 4.4 KEEPALIVE Message Format
  864.  
  865.  
  866.    BGP does not use any transport protocol-based keep-alive mechanism to
  867.    determine if peers are reachable.  Instead, KEEPALIVE messages are
  868.    exchanged between peers often enough as not to cause the hold time
  869.    (as advertised in the OPEN message) to expire.  A reasonable maximum
  870.    time between KEEPALIVE messages would be one third of the Hold Time
  871.    interval.
  872.  
  873.    KEEPALIVE message consists of only message header and has a length of
  874.    19 octets.
  875.  
  876.  
  877. 4.5 NOTIFICATION Message Format
  878.  
  879.  
  880.    A NOTIFICATION message is sent when an error condition is detected.
  881.    The BGP connection is closed immediately after sending it.
  882.  
  883.    In addition to the fixed-size BGP header, the NOTIFICATION message
  884.    contains the following fields:
  885.  
  886.  
  887.         0                   1                   2                   3
  888.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  889.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  890.        | Error code    | Error subcode |           Data                |
  891.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
  892.        |                                                               |
  893.  
  894.  
  895.  
  896. Expiration Date May 1993                                       [Page 16]
  897.  
  898. RFC DRAFT                                                  December 1992
  899.  
  900.  
  901.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  902.  
  903.  
  904.  
  905.       Error Code:
  906.  
  907.          This 1-octet unsigned integer indicates the type of
  908.          NOTIFICATION.  The following Error Codes have been defined:
  909.  
  910.             Error Code       Symbolic Name               Reference
  911.  
  912.               1         Message Header Error             Section 6.1
  913.  
  914.               2         OPEN Message Error               Section 6.2
  915.  
  916.               3         UPDATE Message Error             Section 6.3
  917.  
  918.               4         Hold Timer Expired               Section 6.5
  919.  
  920.               5         Finite State Machine Error       Section 6.6
  921.  
  922.               6         Cease                            Section 6.7
  923.  
  924.  
  925.       Error subcode:
  926.  
  927.          This 1-octet unsigned integer provides more specific
  928.          information about the nature of the reported error.  Each Error
  929.          Code may have one or more Error Subcodes associated with it.
  930.          If no appropriate Error Subcode is defined, then a zero
  931.          (Unspecific) value is used for the Error Subcode field.
  932.  
  933.          Message Header Error subcodes:
  934.  
  935.                                1  - Connection Not Synchronized.
  936.                                2  - Bad Message Length.
  937.                                3  - Bad Message Type.
  938.  
  939.          OPEN Message Error subcodes:
  940.  
  941.                                1  - Unsupported Version Number.
  942.                                2  - Bad Peer AS.
  943.                                3  - Bad BGP Identifier.
  944.                                4  - Unsupported Authentication Code.
  945.                                5  - Authentication Failure.
  946.  
  947.          UPDATE Message Error subcodes:
  948.  
  949.  
  950.  
  951.  
  952. Expiration Date May 1993                                       [Page 17]
  953.  
  954. RFC DRAFT                                                  December 1992
  955.  
  956.  
  957.                                1 - Malformed Attribute List.
  958.                                2 - Unrecognized Well-known Attribute.
  959.                                3 - Missing Well-known Attribute.
  960.                                4 - Attribute Flags Error.
  961.                                5 - Attribute Length Error.
  962.                                6 - Invalid ORIGIN Attribute
  963.                                7 - AS Routing Loop.
  964.                                8 - Invalid NEXT_HOP Attribute.
  965.                                9 - Optional Attribute Error.
  966.                               10 - Invalid Network Field.
  967.                               11 - Malformed AS_PATH.
  968.  
  969.       Data:
  970.  
  971.          This variable-length field is used to diagnose the reason for
  972.          the NOTIFICATION.  The contents of the Data field depend upon
  973.          the Error Code and Error Subcode.  See Section 6 below for more
  974.          details.
  975.  
  976.          Note that the length of the Data field can be determined from
  977.          the message Length field by the formula:
  978.  
  979.                   Message Length = 21 + Data Length
  980.  
  981.  
  982.    The minimum length of the NOTIFICATION message is 21 octets
  983.    (including message header).
  984.  
  985.  
  986. 5.  Path Attributes
  987.  
  988.  
  989.    This section discusses the path attributes of the UPDATE message.
  990.  
  991.    Path attributes fall into four separate categories:
  992.  
  993.                1. Well-known mandatory.
  994.                2. Well-known discretionary.
  995.                3. Optional transitive.
  996.                4. Optional non-transitive.
  997.  
  998.    Well-known attributes must be recognized by all BGP implementations.
  999.    Some of these attributes are mandatory and must be included in every
  1000.    UPDATE message.  Others are discretionary and may or may not be sent
  1001.    in a particular UPDATE message.  Which well-known attributes are
  1002.    mandatory or discretionary is noted in the table below.
  1003.  
  1004.    All well-known attributes must be passed along (after proper
  1005.  
  1006.  
  1007.  
  1008. Expiration Date May 1993                                       [Page 18]
  1009.  
  1010. RFC DRAFT                                                  December 1992
  1011.  
  1012.  
  1013.    updating, if necessary) to other BGP peers.
  1014.  
  1015.    In addition to well-known attributes, each path may contain one or
  1016.    more optional attributes.  It is not required or expected that all
  1017.    BGP implementations support all optional attributes.  The handling of
  1018.    an unrecognized optional attribute is determined by the setting of
  1019.    the Transitive bit in the attribute flags octet.  Paths with
  1020.    unrecognized transitive optional attributes should be accepted. If a
  1021.    path with unrecognized transitive optional attribute is accepted and
  1022.    passed along to other BGP peers, then the unrecognized transitive
  1023.    optional attribute of that path must be passed along with the path to
  1024.    other BGP peers with the Partial bit in the Attribute Flags octet set
  1025.    to 1. If a path with recognized transitive optional attribute is
  1026.    accepted and passed along to other BGP peers and the Partial bit in
  1027.    the Attribute Flags octet is set to 1 by some previous AS, it is not
  1028.    set back to 0 by the current AS. Unrecognized non-transitive optional
  1029.    attributes must be quietly ignored and not passed along to other BGP
  1030.    peers.
  1031.  
  1032.    New transitive optional attributes may be attached to the path by the
  1033.    originator or by any other AS in the path.  If they are not attached
  1034.    by the originator, the Partial bit in the Attribute Flags octet is
  1035.    set to 1.  The rules for attaching new non-transitive optional
  1036.    attributes will depend on the nature of the specific attribute.  The
  1037.    documentation of each new non-transitive optional attribute will be
  1038.    expected to include such rules.  (The description of the
  1039.    MULTI_EXIT_DISC attribute gives an example.)  All optional attributes
  1040.    (both transitive and non-transitive) may be updated (if appropriate)
  1041.    by ASs in the path.
  1042.  
  1043.    The sender of an UPDATE message should order path attributes within
  1044.    the UPDATE message in ascending order of attribute type.  The
  1045.    receiver of an UPDATE message must be prepared to handle path
  1046.    attributes within the UPDATE message that are out of order.
  1047.  
  1048.    The same attribute cannot appear more than once within the Path
  1049.    Attributes field of a particular UPDATE message.
  1050.  
  1051.  
  1052.  
  1053. 5.1 Path Attribute Usage
  1054.  
  1055.  
  1056.    The usage of each BGP path attributes is described in the following
  1057.    clauses.
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064. Expiration Date May 1993                                       [Page 19]
  1065.  
  1066. RFC DRAFT                                                  December 1992
  1067.  
  1068.  
  1069. 5.1.1 ORIGIN
  1070.  
  1071.  
  1072.    ORIGIN is a well-known mandatory attribute. It shall be recognized
  1073.    upon receipt by all BGP speakers. It shall be included in each UPDATE
  1074.    message that includes Network Layer Reachability Information.
  1075.  
  1076.    The ORIGIN attribute shall be generated by the autonomous system that
  1077.    originates the associated routing information. It shall be included
  1078.    in the UPDATE messages of all BGP speakers that choose to propagate
  1079.    this information to other BGP speakers.
  1080.  
  1081.  
  1082. 5.1.2   AS_PATH
  1083.  
  1084.  
  1085.    AS_PATH is a well-known mandatory attribute. It shall be presented in
  1086.    every UPDATE message and shall be recognized upon receipt by all BGP
  1087.    speakers. This attribute identifies the autonomous systems through
  1088.    which routing information carried in this UPDATE message has passed.
  1089.    The components of this list can be AS_SETs or AS_SEQUENCEs.
  1090.  
  1091.    When a BGP speaker propagates a route which it has learned from
  1092.    another BGP speaker's UPDATE message, it shall modify the route's
  1093.    AS_PATH attribute based on the location of the BGP speaker to which
  1094.    the route will be sent:
  1095.  
  1096.       a) When a given BGP speaker advertises the route to another BGP
  1097.       speaker located in its own autonomous system, the advertising
  1098.       speaker shall not modify the AS_PATH attribute associated with the
  1099.       route.
  1100.  
  1101.       b) When a given BGP speaker advertises the route to a BGP speaker
  1102.       located in an adjacent autonomous system, then the advertising
  1103.       speaker shall update the AS_PATH attribute as follows:
  1104.  
  1105.          1) if the first path segment of the AS_PATH is of type
  1106.          AS_SEQUENCE, the local system shall prepend its own AS number
  1107.          as the last element of the sequence  (put it in the leftmost
  1108.          position)
  1109.  
  1110.          2) if the first path segment of the AS_PATH is of type AS_SET,
  1111.          the local system shall prepend a new path segment of type
  1112.          AS_SEQUENCE to the AS_PATH, including its own AS number in that
  1113.          segment.
  1114.  
  1115.       When a BGP speaker originates a route then:
  1116.  
  1117.  
  1118.  
  1119.  
  1120. Expiration Date May 1993                                       [Page 20]
  1121.  
  1122. RFC DRAFT                                                  December 1992
  1123.  
  1124.  
  1125.          a) the originating speaker shall include its own AS number in
  1126.          the AS_PATH attribute of all UPDATE messages sent to BGP
  1127.          speakers located in adjacent autonomous systems. (In this case,
  1128.          the AS number of the originating speaker's autonomous system
  1129.          will be the only entry in the AS_PATH attribute).
  1130.  
  1131.          b) the originating speaker shall include an empty AS_PATH
  1132.          attribute in all UPDATE messages sent to BGP speakers located
  1133.          in its own autonomous system. (An empty AS_PATH attribute is
  1134.          one whose length field contains the value zero).
  1135.  
  1136.  
  1137. 5.1.3 NEXT_HOP
  1138.  
  1139.  
  1140.    The NEXT_HOP path attribute defines the IP address of the border
  1141.    router that should be used as the next hop to the networks listed in
  1142.    the UPDATE message.  If a border router belongs to the same AS as its
  1143.    peer, then the peer is an internal border router. Otherwise, it is an
  1144.    external border router.  A BGP speaker can advertise any internal
  1145.    border router as the next hop provided that the interface associated
  1146.    with the IP address of this border router (as specified in the
  1147.    NEXT_HOP path attribute) shares a common subnet with both the local
  1148.    and remote BGP speakers. A BGP speaker can advertise any external
  1149.    border router as the next hop, provided that the IP address of this
  1150.    border router was learned from one of the BGP speaker's peers, and
  1151.    the interface associated with the IP address of this border router
  1152.    (as specified in the NEXT_HOP path attribute) shares a common subnet
  1153.    with the local and remote BGP speakers.  A BGP speaker needs to be
  1154.    able to support disabling advertisement of external border routers.
  1155.  
  1156.    A BGP speaker must never advertise an address of a neighbor to that
  1157.    neighbor as a NEXT_HOP, for a route that the speaker is originating.
  1158.    A BGP speaker must never install a route with itself as the next hop.
  1159.  
  1160.    When a BGP speaker advertises the route to a BGP speaker located in
  1161.    its own autonomous system, the advertising speaker shall not modify
  1162.    the NEXT_HOP attribute associated with the route.  When a BGP speaker
  1163.    receives the route via an internal link, it may use that NEXT_HOP if
  1164.    the address contained in the attribute is on a common subnet with the
  1165.    local and remote BGP speakers.  The BGP speaker may also use the
  1166.    NEXT_HOP address if the IGP does not contain a route for the
  1167.    destination.
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176. Expiration Date May 1993                                       [Page 21]
  1177.  
  1178. RFC DRAFT                                                  December 1992
  1179.  
  1180.  
  1181. 5.1.4   MULTI_EXIT_DISC
  1182.  
  1183.  
  1184.    The MULTI_EXIT_DISC attribute may be used on external (inter-AS)
  1185.    links to discriminate between multiple exit or entry points to the
  1186.    same neighboring AS.  The value of the MULTI_EXIT_DISC attribute is a
  1187.    1-octet unsigned number which is called a metric.  All other factors
  1188.    being equal, the exit or entry point with lower metric should be
  1189.    preferred.  If received over external links, the MULTI_ EXIT_DISC
  1190.    attribute may be propagated over internal links to other BGP speakers
  1191.    within the same AS.  The MULTI_EXIT_DISC attribute is never
  1192.    propagated to other BGP speakers in neighboring AS's.
  1193.  
  1194.  
  1195. 5.1.5   LOCAL_PREF
  1196.  
  1197.  
  1198.    LOCAL_PREF is a well-known discretionary attribute that shall be
  1199.    included in all UPDATE messages that a given BGP speaker sends to the
  1200.    other BGP speakers located in its own autonomous system. A BGP
  1201.    speaker shall calculate the degree of preference for each external
  1202.    route and include the degree of preference when advertising a route
  1203.    to its internal neighbors. The lower degree of preference should be
  1204.    preferred. A BGP speaker shall use the degree of preference learned
  1205.    via LOCAL_PREF in its decision process (see section 9.1.1).
  1206.  
  1207.    A BGP speaker shall not include this attribute in UPDATE messages
  1208.    that it sends to BGP speakers located in an adjacent autonomous
  1209.    system. It is contained in an UPDATE message that is received from a
  1210.    BGP speaker which is not located in the same autonomous system as the
  1211.    receiving speaker, then this attribute shall be ignored by the
  1212.    receiving speaker.
  1213.  
  1214.  
  1215. 5.1.6   ATOMIC_AGGREGATE
  1216.  
  1217.  
  1218.    ATOMIC_AGGREGATE is a well-known discretionary attribute.  If a BGP
  1219.    speaker, when presented with a set of overlapping routes from one of
  1220.    its peers (see 9.1.4), selects the less specific route without
  1221.    selecting the more specific one, then the local system shall attach
  1222.    the ATOMIC_AGGREGATE attribute to the route when propagating it to
  1223.    other BGP speakers (if that attribute is not already present in the
  1224.    received less specific route). A BGP speaker that receives a route
  1225.    with the ATOMIC_AGGREGATE attribute shall not remove the attribute
  1226.    from the route when propagating it to other speakers. A BGP speaker
  1227.    that receives a route with the ATOMIC_AGGREGATE attribute shall not
  1228.    make any NLRI of that route more specific (as defined in 9.1.4) when
  1229.  
  1230.  
  1231.  
  1232. Expiration Date May 1993                                       [Page 22]
  1233.  
  1234. RFC DRAFT                                                  December 1992
  1235.  
  1236.  
  1237.    advertising this route to other BGP speakers.  A BGP speaker that
  1238.    receives a route with the ATOMIC_AGGREGATE attribute needs to be
  1239.    cognizant of the fact that the actual path to destinations, as
  1240.    specified in the NLRI of the route, while having the loop-free
  1241.    property, may traverse ASs that are not listed in the AS_PATH
  1242.    attribute.
  1243.  
  1244.  
  1245. 5.1.7   AGGREGATOR
  1246.  
  1247.  
  1248.    AGGREGATOR is an optional transitive attribute which may be included
  1249.    in updates which are formed by aggregation (see Section 9.2.4.2).  A
  1250.    BGP speaker which performs route aggregation may add the AGGREGATOR
  1251.    attribute which shall contain its own AS number.
  1252.  
  1253.  
  1254. 6.  BGP Error Handling.
  1255.  
  1256.  
  1257.    This section describes actions to be taken when errors are detected
  1258.    while processing BGP messages.
  1259.  
  1260.    When any of the conditions described here are detected, a
  1261.    NOTIFICATION message with the indicated Error Code, Error Subcode,
  1262.    and Data fields is sent, and the BGP connection is closed.  If no
  1263.    Error Subcode is specified, then a zero must be used.
  1264.  
  1265.    The phrase "the BGP connection is closed" means that the transport
  1266.    protocol connection has been closed and that all resources for that
  1267.    BGP connection have been deallocated.  Routing table entries
  1268.    associated with the remote peer are marked as invalid.  The fact that
  1269.    the routes have become invalid is passed to other BGP peers before
  1270.    the routes are deleted from the system.
  1271.  
  1272.    Unless specified explicitly, the Data field of the NOTIFICATION
  1273.    message that is sent to indicate an error is empty.
  1274.  
  1275.  
  1276. 6.1 Message Header error handling.
  1277.  
  1278.  
  1279.    All errors detected while processing the Message Header are indicated
  1280.    by sending the NOTIFICATION message with Error Code Message Header
  1281.    Error.  The Error Subcode elaborates on the specific nature of the
  1282.    error.
  1283.  
  1284.    The expected value of the Marker field of the message header is all
  1285.  
  1286.  
  1287.  
  1288. Expiration Date May 1993                                       [Page 23]
  1289.  
  1290. RFC DRAFT                                                  December 1992
  1291.  
  1292.  
  1293.    ones if the message type is OPEN.  The expected value of the Marker
  1294.    field for all other types of BGP messages determined based on the
  1295.    Authentication Code in the BGP OPEN message and the actual
  1296.    authentication mechanism (if the Authentication Code in the BGP OPEN
  1297.    message is non-zero). If the Marker field of the message header is
  1298.    not the expected one, then a synchronization error has occurred and
  1299.    the Error Subcode is set to Connection Not Synchronized.
  1300.  
  1301.    If the Length field of the message header is less than 19 or greater
  1302.    than 4096, or if the Length field of an OPEN message is less  than
  1303.    the minimum length of the OPEN message, or if the Length field of an
  1304.    UPDATE message is less than the minimum length of the UPDATE message,
  1305.    or if the Length field of a KEEPALIVE message is not equal to 19, or
  1306.    if the Length field of a NOTIFICATION message is less than the
  1307.    minimum length of the NOTIFICATION message, then the Error Subcode is
  1308.    set to Bad Message Length.  The Data field contains the erroneous
  1309.    Length field.
  1310.  
  1311.    If the Type field of the message header is not recognized, then the
  1312.    Error Subcode is set to Bad Message Type.  The Data field contains
  1313.    the erroneous Type field.
  1314.  
  1315.  
  1316. 6.2 OPEN message error handling.
  1317.  
  1318.  
  1319.    All errors detected while processing the OPEN message are indicated
  1320.    by sending the NOTIFICATION message with Error Code OPEN Message
  1321.    Error.  The Error Subcode elaborates on the specific nature of the
  1322.    error.
  1323.  
  1324.    If the version number contained in the Version field of the received
  1325.    OPEN message is not supported, then the Error Subcode is set to
  1326.    Unsupported Version Number.  The Data field is a 2-octet unsigned
  1327.    integer, which indicates the largest locally supported version number
  1328.    less than the version the remote BGP peer bid (as indicated in the
  1329.    received OPEN message).
  1330.  
  1331.    If the Autonomous System field of the OPEN message is unacceptable,
  1332.    then the Error Subcode is set to Bad Peer AS.  The determination of
  1333.    acceptable Autonomous System numbers is outside the scope of this
  1334.    protocol.
  1335.  
  1336.    If the BGP Identifier field of the OPEN message is syntactically
  1337.    incorrect, then the Error Subcode is set to Bad BGP Identifier.
  1338.    Syntactic correctness means that the BGP Identifier field represents
  1339.    a valid IP host address.
  1340.  
  1341.  
  1342.  
  1343.  
  1344. Expiration Date May 1993                                       [Page 24]
  1345.  
  1346. RFC DRAFT                                                  December 1992
  1347.  
  1348.  
  1349.    If the Authentication Code of the OPEN message is not recognized,
  1350.    then the Error Subcode is set to Unsupported Authentication Code.  If
  1351.    the Authentication Code is zero, then the Authentication Data must be
  1352.    of zero length.  Otherwise, the Error Subcode is set to
  1353.    Authentication Failure.
  1354.  
  1355.    If the Authentication Code is non-zero, then the corresponding
  1356.    authentication procedure is invoked.  If the authentication procedure
  1357.    (based on Authentication Code and Authentication Data) fails, then
  1358.    the Error Subcode is set to Authentication Failure.
  1359.  
  1360.  
  1361. 6.3 UPDATE message error handling.
  1362.  
  1363.  
  1364.    All errors detected while processing the UPDATE message are indicated
  1365.    by sending the NOTIFICATION message with Error Code UPDATE Message
  1366.    Error.  The error subcode elaborates on the specific nature of the
  1367.    error.
  1368.  
  1369.    Error checking of an UPDATE message begins by examining the path
  1370.    attributes.  If the Total Attribute Length is too large (i.e., if
  1371.    Total Attribute Length + 21 exceeds the message Length), or if the
  1372.    (non-negative integer) Number of Network fields cannot be computed as
  1373.    in Section 4.3, then the Error Subcode is set to Malformed Attribute
  1374.    List.
  1375.  
  1376.    If any recognized attribute has Attribute Flags that conflict with
  1377.    the Attribute Type Code, then the Error Subcode is set to Attribute
  1378.    Flags Error.  The Data field contains the erroneous attribute (type,
  1379.    length and value).
  1380.  
  1381.    If any recognized attribute has Attribute Length that conflicts with
  1382.    the expected length (based on the attribute type code), then the
  1383.    Error Subcode is set to Attribute Length Error.  The Data field
  1384.    contains the erroneous attribute (type, length and value).
  1385.  
  1386.    If any of the mandatory well-known attributes are not present, then
  1387.    the Error Subcode is set to Missing Well-known Attribute.  The Data
  1388.    field contains the Attribute Type Code of the missing well-known
  1389.    attribute.
  1390.  
  1391.    If any of the mandatory well-known attributes are not recognized,
  1392.    then the Error Subcode is set to Unrecognized Well-known Attribute.
  1393.    The Data field contains the unrecognized attribute (type, length and
  1394.    value).
  1395.  
  1396.    If the ORIGIN attribute has an undefined value, then the Error
  1397.  
  1398.  
  1399.  
  1400. Expiration Date May 1993                                       [Page 25]
  1401.  
  1402. RFC DRAFT                                                  December 1992
  1403.  
  1404.  
  1405.    Subcode is set to Invalid Origin Attribute.  The Data field contains
  1406.    the unrecognized attribute (type, length and value).
  1407.  
  1408.    If the NEXT_HOP attribute field is syntactically or semantically
  1409.    incorrect, then the Error Subcode is set to Invalid NEXT_HOP
  1410.    Attribute.
  1411.  
  1412.    The Data field contains the incorrect attribute (type, length and
  1413.    value).  Syntactic correctness means that the NEXT_HOP attribute
  1414.    represents a valid IP host address.  Semantic correctness applies
  1415.    only to the external BGP links. It means that the interface
  1416.    associated with the IP address, as specified in the NEXT_HOP
  1417.    attribute, shares a common subnet with the receiving BGP speaker and
  1418.    is not the IP address of the receiving BGP speaker.
  1419.  
  1420.    The AS_PATH attribute is checked for syntactic correctness.  If the
  1421.    path is syntactically incorrect, then the Error Subcode is set to
  1422.    Malformed AS_PATH.
  1423.  
  1424.    The AS route specified by the AS_PATH attribute is checked for AS
  1425.    loops.  AS loop detection is done by scanning the full AS route (as
  1426.    specified in the AS_PATH attribute) and checking that each AS occurs
  1427.    at most once.  If a loop is detected, then the Error Subcode is set
  1428.    to AS Routing Loop.  The Data field contains the incorrect attribute
  1429.    (type, length and value).
  1430.  
  1431.    If an optional attribute is recognized, then the value of this
  1432.    attribute is checked.  If an error is detected, the attribute is
  1433.    discarded, and the Error Subcode is set to Optional Attribute Error.
  1434.    The Data field contains the attribute (type, length and value).
  1435.  
  1436.    If any attribute appears more than once in the UPDATE message, then
  1437.    the Error Subcode is set to Malformed Attribute List.
  1438.  
  1439.    Each Network field in the UPDATE message is checked for syntactic
  1440.    validity.  If the Network field is syntactically incorrect, or
  1441.    contains a subnet or a host address, then the Error Subcode is set to
  1442.    Invalid Network Field.
  1443.  
  1444.  
  1445. 6.4 NOTIFICATION message error handling.
  1446.  
  1447.  
  1448.    If a peer sends a NOTIFICATION message, and there is an error in that
  1449.    message, there is unfortunately no means of reporting this error via
  1450.    a subsequent NOTIFICATION message.  Any such error, such as an
  1451.    unrecognized Error Code or Error Subcode, should be noticed, logged
  1452.    locally, and brought to the attention of the administration of the
  1453.  
  1454.  
  1455.  
  1456. Expiration Date May 1993                                       [Page 26]
  1457.  
  1458. RFC DRAFT                                                  December 1992
  1459.  
  1460.  
  1461.    peer.  The means to do this, however, lies outside the scope of this
  1462.    document.
  1463.  
  1464.  
  1465. 6.5 Hold Timer Expired error handling.
  1466.  
  1467.  
  1468.    If a system does not receive successive KEEPALIVE and/or UPDATE
  1469.    and/or NOTIFICATION messages within the period specified in the Hold
  1470.    Time field of the OPEN message, then the NOTIFICATION message with
  1471.    Hold Timer Expired Error Code must be sent and the BGP connection
  1472.    closed.
  1473.  
  1474.  
  1475. 6.6 Finite State Machine error handling.
  1476.  
  1477.  
  1478.    Any error detected by the BGP Finite State Machine (e.g., receipt of
  1479.    an unexpected event) is indicated by sending the NOTIFICATION message
  1480.    with Error Code Finite State Machine Error.
  1481.  
  1482.  
  1483. 6.7 Cease.
  1484.  
  1485.  
  1486.    In absence of any fatal errors (that are indicated in this section),
  1487.    a BGP peer may choose at any given time to close its BGP connection
  1488.    by sending the NOTIFICATION message with Error Code Cease.  However,
  1489.    the Cease NOTIFICATION message must not be used when a fatal error
  1490.    indicated by this section does exist.
  1491.  
  1492.  
  1493. 6.8 Connection collision detection.
  1494.  
  1495.  
  1496.    If a pair of BGP speakers try simultaneously to establish a TCP
  1497.    connection to each other, then two parallel connections between this
  1498.    pair of speakers might well be formed.  We refer to this situation as
  1499.    connection collision.  Clearly, one of these connections must be
  1500.    closed.
  1501.  
  1502.    Based on the value of the BGP Identifier a convention is established
  1503.    for detecting which BGP connection is to be preserved when a
  1504.    collision does occur. The convention is to compare the BGP
  1505.    Identifiers of the peers involved in the collision and to retain only
  1506.    the connection initiated by the BGP speaker with the higher-valued
  1507.    BGP Identifier.
  1508.  
  1509.  
  1510.  
  1511.  
  1512. Expiration Date May 1993                                       [Page 27]
  1513.  
  1514. RFC DRAFT                                                  December 1992
  1515.  
  1516.  
  1517.    Upon receipt of an OPEN message, the local system must examine all of
  1518.    its connections that are in the OpenConfirm state.  A BGP speaker may
  1519.    also examine connections in an OpenSent state if it knows the BGP
  1520.    Identifier of the neighbor by means outside of the protocol.  If
  1521.    among these connections there is a connection to a remote BGP speaker
  1522.    whose BGP Identifier equals the one in the OPEN message, then the
  1523.    local system performs the following collision resolution procedure:
  1524.  
  1525.  
  1526.       1. The BGP Identifier of the local system is compared to the BGP
  1527.       Identifier of the remote system (as specified in the OPEN
  1528.       message).
  1529.  
  1530.       2. If the value of the local BGP Identifier is less than the
  1531.       remote one, the local system closes BGP connection that already
  1532.       exists (the one that is already in the OpenConfirm state), and
  1533.       accepts BGP connection initiated by the remote system.
  1534.  
  1535.       3. Otherwise, the local system closes newly created BGP connection
  1536.       (the one associated with the newly received OPEN message), and
  1537.       continues to use the existing one (the one that is already in the
  1538.       OpenConfirm state).
  1539.  
  1540.       Comparing BGP Identifiers is done by treating them as (4-octet
  1541.       long) unsigned integers.
  1542.  
  1543.       A connection collision with an existing BGP connection that is in
  1544.       Established states causes unconditional closing of the newly
  1545.       created connection. Note that a connection collision cannot be
  1546.       detected with connections that are in Idle, or Connect, or Active
  1547.       states.
  1548.  
  1549.       Closing the BGP connection (that results from the collision
  1550.       resolution procedure) is accomplished by sending the NOTIFICATION
  1551.       message with the Error Code Cease.
  1552.  
  1553.  
  1554. 7.  BGP Version Negotiation.
  1555.  
  1556.  
  1557.    BGP speakers may negotiate the version of the protocol by making
  1558.    multiple attempts to open a BGP connection, starting with the highest
  1559.    version number each supports.  If an open attempt fails with an Error
  1560.    Code OPEN Message Error, and an Error Subcode Unsupported Version
  1561.    Number, then the BGP speaker has available the version number it
  1562.    tried, the version number its peer tried, the version number passed
  1563.    by its peer in the NOTIFICATION message, and the version numbers that
  1564.    it supports.  If the two peers do support one or more common
  1565.  
  1566.  
  1567.  
  1568. Expiration Date May 1993                                       [Page 28]
  1569.  
  1570. RFC DRAFT                                                  December 1992
  1571.  
  1572.  
  1573.    versions, then this will allow them to rapidly determine the highest
  1574.    common version. In order to support BGP version negotiation, future
  1575.    versions of BGP must retain the format of the OPEN and NOTIFICATION
  1576.    messages.
  1577.  
  1578.  
  1579. 8.  BGP Finite State machine.
  1580.  
  1581.  
  1582.    This section specifies BGP operation in terms of a Finite State
  1583.    Machine (FSM).  Following is a brief summary and overview of BGP
  1584.    operations by state as determined by this FSM.  A condensed version
  1585.    of the BGP FSM is found in Appendix 1.
  1586.  
  1587.       Initially BGP is in the Idle state.
  1588.  
  1589.       Idle state:
  1590.  
  1591.          In this state BGP refuses all incoming BGP connections.  No
  1592.          resources are allocated to the BGP neighbor.  In response to
  1593.          the Start event (initiated by either system or operator) the
  1594.          local system initializes all BGP resources, starts the
  1595.          ConnectRetry timer, initiates a transport connection to other
  1596.          BGP peer, while listening for connection that may be initiated
  1597.          by the remote BGP peer, and changes its state to Connect.  The
  1598.          exact value of the ConnectRetry timer is a local matter, but
  1599.          should be sufficiently large to allow TCP initialization.
  1600.  
  1601.          If a BGP speaker detects an error, it shuts down the connection
  1602.          and changes its state to Idle. Getting out of the Idle state
  1603.          requires generation of the Start event.  If such an event is
  1604.          generated automatically, then persistent BGP errors may result
  1605.          in persistent flapping of the speaker.  To avoid such a
  1606.          condition it is recommended that Start events should not be
  1607.          generated immediately for a peer that was previously
  1608.          transitioned to Idle due to an error. For a peer that was
  1609.          previously transitioned to Idle due to an error, the time
  1610.          between consecutive generation of Start events, if such events
  1611.          are generated automatically, shall exponentially increase. The
  1612.          value of the initial timer shall be 60 seconds. The time shall
  1613.          be doubled for each consecutive retry.
  1614.  
  1615.          Any other event received in the Idle state is ignored.
  1616.  
  1617.       Connect state:
  1618.  
  1619.          In this state BGP is waiting for the transport protocol
  1620.          connection to be completed.
  1621.  
  1622.  
  1623.  
  1624. Expiration Date May 1993                                       [Page 29]
  1625.  
  1626. RFC DRAFT                                                  December 1992
  1627.  
  1628.  
  1629.          If the transport protocol connection succeeds, the local system
  1630.          clears the ConnectRetry timer, completes initialization, sends
  1631.          an OPEN message to its peer, and changes its state to OpenSent.
  1632.  
  1633.          If the transport protocol connect fails (e.g., retransmission
  1634.          timeout), the local system restarts the ConnectRetry timer,
  1635.          continues to listen for a connection that may be initiated by
  1636.          the remote BGP peer, and changes its state to Active state.
  1637.  
  1638.          In response to the ConnectRetry timer expired event, the local
  1639.          system restarts the ConnectRetry timer, initiates a transport
  1640.          connection to other BGP peer, continues to listen for a
  1641.          connection that may be initiated by the remote BGP peer, and
  1642.          stays in the Connect state.
  1643.  
  1644.          Start event is ignored in the Active state.
  1645.  
  1646.          In response to any other event (initiated by either system or
  1647.          operator), the local system releases all BGP resources
  1648.          associated with this connection and changes its state to Idle.
  1649.  
  1650.       Active state:
  1651.  
  1652.          In this state BGP is trying to acquire a BGP neighbor by
  1653.          initiating a transport protocol connection.
  1654.  
  1655.          If the transport protocol connection succeeds, the local system
  1656.          clears the ConnectRetry timer, completes initialization, sends
  1657.          an OPEN message to its peer, sets its hold timer to a large
  1658.          value, and changes its state to OpenSent.
  1659.  
  1660.          In response to the ConnectRetry timer expired event, the local
  1661.          system restarts the ConnectRetry timer, initiates a transport
  1662.          connection to other BGP peer, continues to listen for a
  1663.          connection that may be initiated by the remote BGP peer, and
  1664.          changes its state to Connect.
  1665.  
  1666.          If the local system detects that a remote peer is trying to
  1667.          establish BGP connection to it, and the IP address of the
  1668.          remote peer is not an expected one, the local system restarts
  1669.          the ConnectRetry timer, rejects the attempted connection,
  1670.          continues to listen for a connection that may be initiated by
  1671.          the remote BGP peer, and stays in the Active state.
  1672.  
  1673.          Start event is ignored in the Active state.
  1674.  
  1675.          In response to any other event (initiated by either system or
  1676.          operator), the local system releases all BGP resources
  1677.  
  1678.  
  1679.  
  1680. Expiration Date May 1993                                       [Page 30]
  1681.  
  1682. RFC DRAFT                                                  December 1992
  1683.  
  1684.  
  1685.          associated with this connection and changes its state to Idle.
  1686.  
  1687.       OpenSent state:
  1688.  
  1689.          In this state BGP waits for an OPEN message from its peer.
  1690.          When an OPEN message is received, all fields are checked for
  1691.          correctness.  If the BGP message header checking or OPEN
  1692.          message checking detects an error (see Section 6.2), or a
  1693.          connection collision (see Section 6.8) the local system sends a
  1694.          NOTIFICATION message and changes its state to Idle.
  1695.  
  1696.          If there are no errors in the OPEN message, BGP sends a
  1697.          KEEPALIVE message and sets a KeepAlive timer.  The hold timer,
  1698.          which was originally set to an arbitrary large value (see
  1699.          above), is replaced with the value indicated in the OPEN
  1700.          message. If the value of the Autonomous System field is the
  1701.          same as our own, then the connection is "internal" connection;
  1702.          otherwise, it is "external".  (This will effect UPDATE
  1703.          processing as described below.)  Finally, the state is changed
  1704.          to OpenConfirm.
  1705.  
  1706.          If a disconnect notification is received from the underlying
  1707.          transport protocol, the local system closes the BGP connection,
  1708.          restarts the ConnectRetry timer, while continue listening for
  1709.          connection that may be initiated by the remote BGP peer, and
  1710.          goes into the Active state.
  1711.  
  1712.          If the hold time expires, the local system sends NOTIFICATION
  1713.          message with error code Hold Timer Expired and changes its
  1714.          state to Idle.
  1715.  
  1716.          In response to the Stop event (initiated by either system or
  1717.          operator) the local system sends NOTIFICATION message with
  1718.          Error Code Cease and changes its state to Idle.
  1719.  
  1720.          Start event is ignored in the OpenSent state.
  1721.  
  1722.          In response to any other event the local system sends
  1723.          NOTIFICATION message with Error Code Finite State Machine Error
  1724.          and changes its state to Idle.
  1725.  
  1726.          Whenever BGP changes its state from OpenSent to Idle, it closes
  1727.          the BGP (and transport-level) connection and releases all
  1728.          resources associated with that connection.
  1729.  
  1730.       OpenConfirm state:
  1731.  
  1732.          In this state BGP waits for a KEEPALIVE or NOTIFICATION
  1733.  
  1734.  
  1735.  
  1736. Expiration Date May 1993                                       [Page 31]
  1737.  
  1738. RFC DRAFT                                                  December 1992
  1739.  
  1740.  
  1741.          message.
  1742.  
  1743.          If the local system receives a KEEPALIVE message, it changes
  1744.          its state to Established.
  1745.  
  1746.          If the hold timer expires before a KEEPALIVE message is
  1747.          received, the local system sends NOTIFICATION message with
  1748.          error code Hold Timer expired and changes its state to Idle.
  1749.  
  1750.          If the local system receives a NOTIFICATION message, it changes
  1751.          its state to Idle.
  1752.  
  1753.          If the KeepAlive timer expires, the local system sends a
  1754.          KEEPALIVE message and restarts its KeepAlive timer.
  1755.  
  1756.          If a disconnect notification is received from the underlying
  1757.          transport protocol, the local system changes its state to Idle.
  1758.  
  1759.          In response to the Stop event (initiated by either system or
  1760.          operator) the local system sends NOTIFICATION message with
  1761.          Error Code Cease and changes its state to Idle.
  1762.  
  1763.          Start event is ignored in the OpenConfirm state.
  1764.  
  1765.          In response to any other event the local system sends
  1766.          NOTIFICATION message with Error Code Finite State Machine Error
  1767.          and changes its state to Idle.
  1768.  
  1769.          Whenever BGP changes its state from OpenConfirm to Idle, it
  1770.          closes the BGP (and transport-level) connection and releases
  1771.          all resources associated with that connection.
  1772.  
  1773.       Established state:
  1774.  
  1775.          In the Established state BGP can exchange UPDATE, NOTIFICATION,
  1776.          and KEEPALIVE messages with its peer.
  1777.  
  1778.          If the local system receives an UPDATE or KEEPALIVE message, it
  1779.          restarts its Holdtime timer.
  1780.  
  1781.          If the local system receives a NOTIFICATION message, it changes
  1782.          its state to Idle.
  1783.  
  1784.          If the local system receives an UPDATE message and the UPDATE
  1785.          message error handling procedure (see Section 6.3) detects an
  1786.          error, the local system sends a NOTIFICATION message and
  1787.          changes its state to Idle.
  1788.  
  1789.  
  1790.  
  1791.  
  1792. Expiration Date May 1993                                       [Page 32]
  1793.  
  1794. RFC DRAFT                                                  December 1992
  1795.  
  1796.  
  1797.          If a disconnect notification is received from the underlying
  1798.          transport protocol, the local system changes its state to Idle.
  1799.  
  1800.          If the Holdtime timer expires, the local system sends a
  1801.          NOTIFICATION message with Error Code Hold Timer Expired and
  1802.          changes its state to Idle.
  1803.  
  1804.          If the KeepAlive timer expires, the local system sends a
  1805.          KEEPALIVE message and restarts its KeepAlive timer.
  1806.  
  1807.          Each time the local system sends a KEEPALIVE or UPDATE message,
  1808.          it restarts its KeepAlive timer.
  1809.  
  1810.          In response to the Stop event (initiated by either system or
  1811.          operator), the local system sends a NOTIFICATION message with
  1812.          Error Code Cease and changes its state to Idle.
  1813.  
  1814.          Start event is ignored in the Established state.
  1815.  
  1816.          In response to any other event, the local system sends
  1817.          NOTIFICATION message with Error Code Finite State Machine Error
  1818.          and changes its state to Idle.
  1819.  
  1820.          Whenever BGP changes its state from Established to Idle, it
  1821.          closes the BGP (and transport-level) connection, releases all
  1822.          resources associated with that connection, and deletes all
  1823.          routes derived from that connection.
  1824.  
  1825.  
  1826. 9.  UPDATE Message Handling
  1827.  
  1828.  
  1829.    An UPDATE message may be received only in the Established state.
  1830.    When an UPDATE message is received, each field is checked for
  1831.    validity as specified in Section 6.3.
  1832.  
  1833.    If an optional non-transitive attribute is unrecognized, it is
  1834.    quietly ignored.  If an optional transitive attribute is
  1835.    unrecognized, the Partial bit (the third high-order bit) in the
  1836.    attribute flags octet is set to 1, and the attribute is retained for
  1837.    propagation to other BGP speakers.
  1838.  
  1839.    If an optional attribute is recognized, and has a valid value, then,
  1840.    depending on the type of the optional attribute, it is processed
  1841.    locally, retained, and updated, if necessary, for possible
  1842.    propagation to other BGP speakers.
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. Expiration Date May 1993                                       [Page 33]
  1849.  
  1850. RFC DRAFT                                                  December 1992
  1851.  
  1852.  
  1853.    If the UPDATE message contains a non-empty WITHDRAWN ROUTES field,
  1854.    the previously advertised routes whose  destinations (expressed as IP
  1855.    prefixes) contained in this field shall be removed from the Adj-RIB-
  1856.    In.  This BGP speaker shall run its Decision Process since the
  1857.    previously advertised route is not longer available for use.
  1858.  
  1859.    If the UPDATE message contains a feasible route, it shall be placed
  1860.    in the appropriate Adj-RIB-In, and the following additional actions
  1861.    shall be taken:
  1862.  
  1863.    i) If its Network Layer Reachability Information (NLRI) is identical
  1864.    to the one of a route currently stored in the Adj-RIB-In, then the
  1865.    new route shall replace the older route in the Adj-RIB-In, thus
  1866.    implicitly withdrawing the older route from service. The BGP speaker
  1867.    shall run its Decision Process since the older route is no longer
  1868.    available for use.
  1869.  
  1870.    ii) If the new route is an overlapping route that is included (see
  1871.    9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP
  1872.    speaker shall run its Decision Process since the more specific route
  1873.    has implicitly made a portion of the less specific route unavailable
  1874.    for use.
  1875.  
  1876.    iii) If the new route has identical path attributes to an earlier
  1877.    route contained in the Adj-RIB-In, and is more specific (see 9.1.4)
  1878.    than the earlier route, no further actions are necessary.
  1879.  
  1880.    iv) If the new route has NLRI that is not present in any of the
  1881.    routes currently stored in the Adj-RIB-In, then the new route shall
  1882.    be placed in the Adj-RIB-In. The BGP speaker shall run its Decision
  1883.    Process.
  1884.  
  1885.    v) If the new route is an overlapping route that is less specific
  1886.    (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the
  1887.    BGP speaker shall run its Decision Process on the set of destinations
  1888.    described only by the less specific route.
  1889.  
  1890.  
  1891. 9.1 Decision Process
  1892.  
  1893.  
  1894.    The Decision Process selects routes for subsequent advertisement by
  1895.    applying the policies in the local Policy Information Base (PIB) to
  1896.    the routes stored in its Adj-RIB-In. The output of the Decision
  1897.    Process is the set of routes that will be advertised to adjacent BGP
  1898.    speakers; the selected routes will be stored in the local speaker's
  1899.    Adj-RIB-Out.
  1900.  
  1901.  
  1902.  
  1903.  
  1904. Expiration Date May 1993                                       [Page 34]
  1905.  
  1906. RFC DRAFT                                                  December 1992
  1907.  
  1908.  
  1909.    The selection process is formalized by defining a function that takes
  1910.    the attribute of a given route as an argument and returns a non-
  1911.    negative integer denoting the degree of preference for the route.
  1912.    The function that calculates the degree of preference for a given
  1913.    route shall not use as its inputs any of the following:  the
  1914.    existence of other routes, the non-existence of other routes, or the
  1915.    path attributes of other routes. Route selection then consists of
  1916.    individual application of the degree of preference function to each
  1917.    feasible route, followed by the choice of the one with the highest
  1918.    degree of preference.
  1919.  
  1920.    The Decision Process operates on routes contained in each Adj-RIB-In,
  1921.    and is responsible for:
  1922.  
  1923.       - selection of routes to be advertised to BGP speakers located in
  1924.       the local speaker's autonomous system
  1925.  
  1926.       - selection of routes to be advertised to BGP speakers located in
  1927.       adjacent autonomous systems
  1928.  
  1929.       - route aggregation and route information reduction
  1930.  
  1931.    The Decision Process takes place in three distinct phases, each
  1932.    triggered by a different event:
  1933.  
  1934.       a) Phase 1 is responsible for calculating the degree of preference
  1935.       for each route received from a BGP speaker located in an adjacent
  1936.       autonomous system, and for advertising to the other BGP speakers
  1937.       in the local autonomous system the routes that have the highest
  1938.       degree of preference for each distinct destination.
  1939.  
  1940.       b) Phase 2 is invoked on completion of phase 1. It is responsible
  1941.       for choosing the best route out of all those available for each
  1942.       distinct destination, and for installing each chosen route into
  1943.       the appropriate Loc-RIB.
  1944.  
  1945.       c) Phase 3 is invoked after the Loc-RIB has been modified. It is
  1946.       responsible for disseminating routes in the Loc-RIB to each
  1947.       adjacent BGP speaker located in an adjacent autonomous system,
  1948.       according to the policies contained in the PIB. Route aggregation
  1949.       and information reduction can optionally be performed within this
  1950.       phase.
  1951.  
  1952.  
  1953. 9.1.1 Phase 1: Calculation of Degree of Preference
  1954.  
  1955.  
  1956.    The Phase 1 decision function shall be invoked whenever the local BGP
  1957.  
  1958.  
  1959.  
  1960. Expiration Date May 1993                                       [Page 35]
  1961.  
  1962. RFC DRAFT                                                  December 1992
  1963.  
  1964.  
  1965.    speaker receives an UPDATE message from a neighboring BGP speaker
  1966.    located in an adjacent autonomous system that advertises a new route,
  1967.    a replacement route, or a withdrawn route.
  1968.  
  1969.    The Phase 1 decision function is a separate process which completes
  1970.    when it has no further work to do.
  1971.  
  1972.    The Phase 1 decision function shall lock an Adj-RIB-In prior to
  1973.    operating on any route contained within it, and shall unlock it after
  1974.    operating on all new or unfeasible routes contained within it.
  1975.  
  1976.    For each newly received or replacement feasible route, the local BGP
  1977.    speaker shall determine a degree of preference. If the route is
  1978.    learned from a BGP speaker in the local autonomous system, either the
  1979.    value of the LOCAL_PREF attribute shall be taken as the degree of
  1980.    preference, or the local system shall compute the degree of
  1981.    preference of the route based on preconfigured policy information. If
  1982.    the route is learned from a BGP speaker in an adjacent autonomous
  1983.    system, then the degree of preference shall be computed based on
  1984.    preconfigured policy information.  The exact nature of this policy
  1985.    information and the computation involved is a local matter.  The
  1986.    local speaker shall then run the internal update process of 9.2.1 to
  1987.    select and advertise the most preferable route.
  1988.  
  1989.  
  1990. 9.1.2 Phase 2: Route Selection
  1991.  
  1992.  
  1993.    The Phase 2 decision function shall be invoked on completion of Phase
  1994.    1.  The Phase 2 function is a separate process which completes when
  1995.    it has no further work to do. The Phase 2 process shall consider all
  1996.    routes that are present in the Adj-RIBs-In, including those received
  1997.    from BGP speakers located in its own autonomous system and those
  1998.    received from BGP speakers located in adjacent autonomous systems.
  1999.  
  2000.    The Phase 2 decision function shall be blocked from running while the
  2001.    Phase 3 decision function is in process. The Phase 2 function shall
  2002.    lock all Adj-RIBs-In prior to commencing its function, and shall
  2003.    unlock them on completion.
  2004.  
  2005.    For each set of destinations for which a feasible route exists in the
  2006.    Adj-RIBs-In, the local BGP speaker shall identify the route that has:
  2007.  
  2008.       a) the highest degree of preference of any route to the same set
  2009.       of destinations, or
  2010.  
  2011.       b) is the only route to that destination, or
  2012.  
  2013.  
  2014.  
  2015.  
  2016. Expiration Date May 1993                                       [Page 36]
  2017.  
  2018. RFC DRAFT                                                  December 1992
  2019.  
  2020.  
  2021.       c) is selected as a result of the Phase 2 tie breaking rules
  2022.       specified in 9.1.2.1.
  2023.  
  2024.  
  2025.    An alternative procedure for selecting a route may be realized if a
  2026.    BGP speaker can ascertain whether a particular route the speaker
  2027.    wants to select is also present in the interior routing protocol
  2028.    (IGP) of the autonomous system the speaker belongs to, and that the
  2029.    BGP speaker that injected the route into the IGP has this route
  2030.    installed in its Loc-RIB. A BGP speaker may select a route, provided
  2031.    that the following conditions are satisfied:
  2032.  
  2033.       a) the NLRI of the route is present in the IGP of the autonomous
  2034.       system the speaker belongs to
  2035.  
  2036.       b) the BGP speaker that injected the NLRI into the IGP has the
  2037.       route in its Loc-RIB
  2038.  
  2039.       c) the BGP speaker that injected the NLRI into the IGP  will be
  2040.       used as an exit point by the IGP.
  2041.  
  2042.    The exact procedures for verifying the above conditions are specific
  2043.    to a particular IGP and are outside the scope of this document.
  2044.  
  2045.    The local speaker shall then install that route in the Loc-RIB,
  2046.    replacing any route to the same destination that is currently being
  2047.    held in the Loc-RIB.
  2048.  
  2049.    Unfeasible routes shall be removed from the Loc-RIB, and
  2050.    corresponding unfeasible routes shall then be removed from the Adj-
  2051.    RIBs-In.
  2052.  
  2053.  
  2054. 9.1.2.1 Breaking Ties (Phase 2)
  2055.  
  2056.  
  2057.    In its Adj-RIBs-In a BGP speaker may have several routes to the same
  2058.    destination that have the same degree of preference. The local
  2059.    speaker can select only one of these routes for inclusion in the
  2060.    associated Loc-RIB. The local speaker considers all equally
  2061.    preferable routes, both those received from BGP speakers located in
  2062.    adjacent autonomous systems, and those received from other BGP
  2063.    speakers located in the local speaker's autonomous system.
  2064.  
  2065.    Ties shall be broken according to the following rules:
  2066.  
  2067.       a) If the candidate routes have identical path attributes or
  2068.       differ only in the NEXT_HOP attribute, select the route that was
  2069.  
  2070.  
  2071.  
  2072. Expiration Date May 1993                                       [Page 37]
  2073.  
  2074. RFC DRAFT                                                  December 1992
  2075.  
  2076.  
  2077.       advertised by the BGP speaker in an adjacent autonomous system
  2078.       whose BGP Identifier has the lowest value. If none of the
  2079.       candidate routes were received from a BGP speaker located in an
  2080.       adjacent autonomous system, select the route that was advertised
  2081.       by the BGP speaker in the local autonomous system whose BGP
  2082.       Identifier has the lowest value.
  2083.  
  2084.       b) If the candidate routes differ only in their NEXT_HOP and
  2085.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2086.       take into account MULTI_EXIT_DISC, select the route that has the
  2087.       lowest value of the MULTI_EXIT_DISC attribute.
  2088.  
  2089.       If the local system is configured to ignore MULTI_EXIT_DISC,
  2090.       select the route advertised by the BGP speaker in an adjacent
  2091.       autonomous system whose BGP Identifier has the lowest value.  If
  2092.       none of the candidate routes were received from a BGP speaker
  2093.       located in an adjacent autonomous system, select the route that
  2094.       was advertised by the BGP speaker in the local autonomous system
  2095.       whose BGP Identifier has the lowest value.
  2096.  
  2097.       c) If the candidate routes differ in any path attributes other
  2098.       than NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes
  2099.       were advertised by the BGP speakers within the local autonomous
  2100.       system, select the route that was advertised by the BGP speaker
  2101.       whose BGP identifier has the lowest value.
  2102.  
  2103.       If the candidate routes differ in any path attributes other than
  2104.       NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes were
  2105.       advertised by the BGP speakers in adjacent autonomous systems,
  2106.       select the route that was advertised by the BGP speaker whose BGP
  2107.       identifier has the lowest value.
  2108.  
  2109.       If the candidate routes differ in any path attributes other than
  2110.       NEXT_HOP and MULTI_EXIT_DISC, and some of the candidate routes
  2111.       were advertised by the BGP speakers in adjacent autonomous system,
  2112.       while others were advertised by the BGP speakers within the local
  2113.       autonomous system, the local system shall determine the BGP
  2114.       speaker within the local autonomous system whose BGP identifier
  2115.       has the lowest value and is advertising a candidate route
  2116.       (including itself).
  2117.  
  2118.       If this speaker is the local system, then select the route that
  2119.       was advertised by the BGP speaker in an adjacent autonomous system
  2120.       whose BGP identifier has the lowest value among all other BGP
  2121.       speakers in adjacent autonomous systems.
  2122.  
  2123.       Otherwise (if the BGP identifier of the local system is not the
  2124.       lowest among all BGP speakers within the local autonomous system
  2125.  
  2126.  
  2127.  
  2128. Expiration Date May 1993                                       [Page 38]
  2129.  
  2130. RFC DRAFT                                                  December 1992
  2131.  
  2132.  
  2133.       advertising a candidate route), select the route that was
  2134.       advertised by the BGP speaker within the local autonomous system
  2135.       whose BGP identifier has the lowest value.
  2136.  
  2137.  
  2138. 9.1.3   Phase 3: Route Dissemination
  2139.  
  2140.  
  2141.    The Phase 3 decision function shall be invoked on completion of Phase
  2142.    2, or when any of the following events occur:
  2143.  
  2144.       a) when routes in a Loc-RIB to local destinations have changed
  2145.  
  2146.       b) when locally generated routes learned by means outside of BGP
  2147.       have changed
  2148.  
  2149.       c) when a new BGP speaker - BGP speaker connection has been
  2150.       established
  2151.  
  2152.    The Phase 3 function is a separate process which completes when it
  2153.    has no further work to do. The Phase 3 Routing Decision function
  2154.    shall be blocked from running while the Phase 2 decision function is
  2155.    in process.
  2156.  
  2157.    All routes in the Loc-RIB shall be processed into a corresponding
  2158.    entry in the associated Adj-RIBs-Out. Route aggregation and
  2159.    information reduction techniques (see 9.2.4.1) may optionally be
  2160.    applied.
  2161.  
  2162.  
  2163.    For the benefit of future support of inter-AS multicast capabilities,
  2164.    a BGP speaker that participates in the inter-AS multicast shall
  2165.    advertise a route it receives from one of its external peers and
  2166.    installs in its Loc-RIB back to the peer from which the route was
  2167.    received. For a BGP speaker that does not participate in the inter-AS
  2168.    multicast such an advertisement is optional. When doing such an
  2169.    advertisement, the NEXT_HOP attribute should be set to the address of
  2170.    the peer. An implementation may also optimize such an advertisement
  2171.    by truncating information in the AS_PATH attribute to include only
  2172.    its own AS number and that of the peer that advertised the route
  2173.    (such truncation requires the ORIGIN attribute to be set to
  2174.    INCOMPLETE).  In addition an implementation is not required to pass
  2175.    optional or discretionary path attributes with such an advertisement.
  2176.  
  2177.    When the updating of the Adj-RIBs-Out and the Forwarding Information
  2178.    Base (FIB) is complete, the local BGP speaker shall run the external
  2179.    update process of 9.2.2.
  2180.  
  2181.  
  2182.  
  2183.  
  2184. Expiration Date May 1993                                       [Page 39]
  2185.  
  2186. RFC DRAFT                                                  December 1992
  2187.  
  2188.  
  2189. 9.1.4 Overlapping Routes
  2190.  
  2191.  
  2192.    A BGP speaker may transmit routes with overlapping Network Layer
  2193.    Reachability Information (NLRI) to another BGP speaker. NLRI overlap
  2194.    occurs when a set of destinations are identified in non-matching
  2195.    multiple routes. Since BGP encodes NLRI using IP prefixes, overlap
  2196.    will always exhibit subset relationships.  A route describing a
  2197.    smaller set of destinations (a longer prefix) is said to be more
  2198.    specific than a route describing a larger set of destinations (a
  2199.    shorted prefix); similarly, a route describing a larger set of
  2200.    destinations (a shorter prefix) is said to be less specific than a
  2201.    route describing a smaller set of destinations (a longer prefix).
  2202.  
  2203.    The precedence relationship effectively decomposes less specific
  2204.    routes into two parts:
  2205.  
  2206.       -  a set of destinations described only by the less specific
  2207.       route, and
  2208.  
  2209.       -  a set of destinations described by the overlap of the less
  2210.       specific and the more specific routes
  2211.  
  2212.  
  2213.    When overlapping routes are present in the same Adj-RIB-In, the more
  2214.    specific route shall take precedence, in order from more specific to
  2215.    least specific.
  2216.  
  2217.    The set of destinations described by the overlap represents a portion
  2218.    of the less specific route that is feasible, but is not currently in
  2219.    use.  If a more specific route is later withdrawn, the set of
  2220.    destinations described by the overlap will still be reachable using
  2221.    the less specific route.
  2222.  
  2223.    If a BGP speaker receives overlapping routes, the Decision Process
  2224.    shall take into account the semantics of the overlapping routes. In
  2225.    particular, if a BGP speaker accepts the less specific route while
  2226.    rejecting the more specific route from the same neighbor, then the
  2227.    destinations represented by the overlap may not forward along the ASs
  2228.    listed in the AS_PATH attribute of that route. Therefore, a BGP
  2229.    speaker has the following choices:
  2230.  
  2231.       a)   Install both the less and the more specific routes
  2232.  
  2233.       b)   Install the more specific route only
  2234.  
  2235.       c)   Install the non-overlapping part of the less specific
  2236.                  route only (that implies de-aggregation)
  2237.  
  2238.  
  2239.  
  2240. Expiration Date May 1993                                       [Page 40]
  2241.  
  2242. RFC DRAFT                                                  December 1992
  2243.  
  2244.  
  2245.       d)   Aggregate the two routes and install the aggregated route
  2246.  
  2247.       e)   Install the less specific route only
  2248.  
  2249.       f)   Install neither route
  2250.  
  2251.    If a BGP speaker chooses e), then it should add ATOMIC_AGGREGATE
  2252.    attribute to the route. A route that carries ATOMIC_AGGREGATE
  2253.    attribute can not be de-aggregated. That is, the NLRI of this route
  2254.    can not be made more specific.  Forwarding along such a route does
  2255.    not guarantee that IP packets will actually traverse only ASs listed
  2256.    in the AS_PATH attribute of the route.  If a BGP speaker chooses a),
  2257.    it must not advertise the more general route without the more
  2258.    specific route.
  2259.  
  2260.  
  2261. 9.2 Update-Send Process
  2262.  
  2263.  
  2264.    The Update-Send process is responsible for advertising UPDATE
  2265.    messages to adjacent BGP speakers. For example, it distributes the
  2266.    routes chosen by the Decision Process to other BGP speakers which may
  2267.    be located in either the same autonomous system or an adjacent
  2268.    autonomous system.  Rules for information exchange between BGP
  2269.    speakers located in different autonomous systems are given in 9.2.2;
  2270.    rules for information exchange between BGP speakers located in the
  2271.    same autonomous system are given in 9.2.1.
  2272.  
  2273.    Distribution of routing information between a set of BGP speakers,
  2274.    all of which are located in the same autonomous system, is referred
  2275.    to as internal distribution.
  2276.  
  2277.  
  2278. 9.2.1 Internal Updates
  2279.  
  2280.  
  2281.    The Internal update process is concerned with the distribution of
  2282.    routing information to BGP speakers located in the local speaker's
  2283.    autonomous system.
  2284.  
  2285.    When a BGP speaker receives an UPDATE message from another BGP
  2286.    speaker located in its own autonomous system, the receiving BGP
  2287.    speaker shall not re-distribute the routing information contained in
  2288.    that UPDATE message to other BGP speakers located in its own
  2289.    autonomous system.
  2290.  
  2291.    When a BGP speaker receives a new route from a BGP speaker in an
  2292.    adjacent autonomous system, it shall advertise that route to all
  2293.  
  2294.  
  2295.  
  2296. Expiration Date May 1993                                       [Page 41]
  2297.  
  2298. RFC DRAFT                                                  December 1992
  2299.  
  2300.  
  2301.    other BGP speakers in its autonomous system by means of an UPDATE
  2302.    message if any of the following conditions occur:
  2303.  
  2304.       1) the degree of preference assigned to the newly received route
  2305.       by the local BGP speaker is higher than the degree of preference
  2306.       that the local speaker has assigned to other routes that have been
  2307.       received from BGP speakers in adjacent autonomous systems, or
  2308.  
  2309.       2) there are no other routes that have been received from BGP
  2310.       speakers in adjacent autonomous systems, or
  2311.  
  2312.       3) the newly received route is selected as a result of breaking a
  2313.       tie between several routes which have the highest degree of
  2314.       preference, and the same destination.
  2315.  
  2316.    When a BGP speaker receives an UPDATE message with a non-empty
  2317.    WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all
  2318.    routes whose destinations was carried in this field (as IP prefixes).
  2319.    The speaker shall take the following additional steps:
  2320.  
  2321.       1) if the corresponding feasible route had not been previously
  2322.       advertised, then no further action is necessary
  2323.  
  2324.       2) if the corresponding feasible route had been previously
  2325.       advertised, then:
  2326.  
  2327.          i) if a new route is selected for advertisement that has the
  2328.          same Network Layer Reachability Information as the unfeasible
  2329.          routes, then the local BGP speaker shall advertise the
  2330.          replacement route
  2331.  
  2332.          ii) if a replacement route is not available for advertisement,
  2333.          then the BGP speaker shall include the destinations  of the
  2334.          unfeasible route (in form of IP prefixes) in the WITHDRAWN
  2335.          ROUTES field of an UPDATE message, and shall send this message
  2336.          to each neighbor BGP speaker to whom it had previously
  2337.          advertised the corresponding feasible route.
  2338.  
  2339.  
  2340.    All feasible routes which are advertised shall be placed in the
  2341.    appropriate Adj-RIBs-Out, and all unfeasible routes which are
  2342.    advertised shall be removed from the Adj-RIBs-Out.
  2343.  
  2344.  
  2345. 9.2.1.1 Breaking Ties (Internal Updates)
  2346.  
  2347.  
  2348.    If a local BGP speaker has connections to several BGP speakers in
  2349.  
  2350.  
  2351.  
  2352. Expiration Date May 1993                                       [Page 42]
  2353.  
  2354. RFC DRAFT                                                  December 1992
  2355.  
  2356.  
  2357.    adjacent autonomous systems, there will be multiple Adj-RIBs-In
  2358.    associated with these neighbors. These Adj-RIBs-In might contain
  2359.    several equally preferable routes to the same destination, all of
  2360.    which were advertised by BGP speakers located in adjacent autonomous
  2361.    systems. The local BGP speaker shall select one of these routes
  2362.    according to the following rules:
  2363.  
  2364.       a) If the candidate route differ only in their NEXT_HOP and
  2365.       MULTI_EXIT_DISC attributes, and the local system is configured to
  2366.       take into account MULTI_EXIT_DISC attribute, select the routes
  2367.       that has the lowest value of the MULTI_EXIT_DISC attribute.
  2368.  
  2369.       b) In all other cases, select the route that was advertised by the
  2370.       BGP speaker whose BGP Identifier has the lowest value.
  2371.  
  2372.  
  2373.  
  2374. 9.2.2 External Updates
  2375.  
  2376.  
  2377.    The external update process is concerned with the distribution of
  2378.    routing information to BGP speakers located in adjacent autonomous
  2379.    systems. As part of Phase 3 route selection process, the BGP speaker
  2380.    has updated its Adj-RIBs-Out and its Forwarding Table. All newly
  2381.    installed routes and all newly unfeasible routes for which there is
  2382.    no replacement route shall be advertised to BGP speakers located in
  2383.    adjacent autonomous systems by means of UPDATE message.
  2384.  
  2385.    Any routes in the Loc-RIB marked as unfeasible shall be removed.
  2386.    Changes to the reachable destinations within its own autonomous
  2387.    system shall also be advertised in an UPDATE message.
  2388.  
  2389.  
  2390. 9.2.3 Controlling Routing Traffic Overhead
  2391.  
  2392.  
  2393.    The BGP protocol constrains the amount of routing traffic (that is,
  2394.    UPDATE messages) in order to limit both the link bandwidth needed to
  2395.    advertise UPDATE messages and the processing power needed by the
  2396.    Decision Process to digest the information contained in the UPDATE
  2397.    messages.
  2398.  
  2399.  
  2400. 9.2.3.1 Frequency of Route Advertisement
  2401.  
  2402.  
  2403.    The parameter MinRouteAdvertisementInterval determines the minimum
  2404.    amount of time that must elapse between advertisement of routes to a
  2405.  
  2406.  
  2407.  
  2408. Expiration Date May 1993                                       [Page 43]
  2409.  
  2410. RFC DRAFT                                                  December 1992
  2411.  
  2412.  
  2413.    particular destination from a single BGP speaker. This rate limiting
  2414.    procedure applies on a per-destination basis, although the value of
  2415.    MinRouteAdvertisementInterval is set on a per BGP peer basis.
  2416.  
  2417.    Two UPDATE messages sent from a single BGP speaker that advertise
  2418.    feasible routes to some common set of destinations received from BGP
  2419.    speakers in adjacent autonomous systems must be separated by at least
  2420.    MinRouteAdvertisementInterval. Clearly, this can only be achieved
  2421.    precisely by keeping a separate timer for each common set of
  2422.    destinations. This would be unwarranted overhead. Any technique which
  2423.    ensures that the interval between two UPDATE messages sent from a
  2424.    single BGP speaker that advertise feasible routes to some common set
  2425.    of destinations received from BGP speakers in adjacent autonomous
  2426.    systems will be at least MinRouteAdvertisementInterval, and will also
  2427.    ensure a constant upper bound on the interval is acceptable.
  2428.  
  2429.    Since fast convergence is needed within an autonomous system, this
  2430.    procedure does not apply for routes receives from other BGP speakers
  2431.    in the same autonomous system. To avoid long-lived black holes, the
  2432.    procedure does not apply to the explicit withdrawal of unfeasible
  2433.    routes (that is, routes whose destinations (expressed as IP prefixes)
  2434.    are listed in the WITHDRAWN ROUTES field of an UPDATE message).
  2435.  
  2436.    This procedure does not limit the rate of route selection, but only
  2437.    the rate of route advertisement. If new routes are selected multiple
  2438.    times while awaiting the expiration of MinRouteAdvertisementInterval,
  2439.    the last route selected shall be advertised at the end of
  2440.    MinRouteAdvertisementInterval.
  2441.  
  2442.  
  2443. 9.2.3.2 Frequency of Route Origination
  2444.  
  2445.  
  2446.    The parameter MinASOriginationInterval determines the minimum amount
  2447.    of time that must elapse between successive advertisements of UPDATE
  2448.    messages that report changes within the advertising BGP speaker's own
  2449.    autonomous systems.
  2450.  
  2451.  
  2452. 9.2.3.3 Jitter
  2453.  
  2454.  
  2455.    To minimize the likelihood that the distribution of BGP messages by a
  2456.    given BGP speaker will contain peaks, jitter should be applied to the
  2457.    timers associated with MinASOriginationInterval, Keepalive, and
  2458.    MinRouteAdvertisementInterval. A given BGP speaker shall apply the
  2459.    same jitter to each of these quantities regardless of the
  2460.    destinations to which the updates are being sent; that is, jitter
  2461.  
  2462.  
  2463.  
  2464. Expiration Date May 1993                                       [Page 44]
  2465.  
  2466. RFC DRAFT                                                  December 1992
  2467.  
  2468.  
  2469.    will not be applied on a "per peer" basis.
  2470.  
  2471.  
  2472.  
  2473. 9.2.4 Efficient Organization of Routing Information
  2474.  
  2475.  
  2476.    Having selected the routing information which it will advertise, a
  2477.    BGP speaker may avail itself of several methods to organize this
  2478.    information in an efficient manner.
  2479.  
  2480.  
  2481. 9.2.4.1 Information Reduction
  2482.  
  2483.  
  2484.    Information reduction may imply a reduction in granularity of policy
  2485.    control - after information is collapsed, the same policies will
  2486.    apply to all destinations and paths in the equivalence class.
  2487.  
  2488.    The Decision Process may optionally reduce the amount of information
  2489.    that it will place in the Adj-RIBs-Out by any of the following
  2490.    methods:
  2491.  
  2492.       a)   Network Layer Reachability Information (NLRI):
  2493.  
  2494.       Destination IP addresses can be represented as IP address
  2495.       prefixes.  In cases where there is a correspondence between the
  2496.       address structure and the systems under control of an autonomous
  2497.       system administrator, it will be possible to reduce the size of
  2498.       the NLRI carried in the UPDATE messages.
  2499.  
  2500.       b)   AS_PATHs:
  2501.  
  2502.       AS path information can be represented as ordered AS_SEQUENCEs or
  2503.       unordered AS_SETs. AS_SETs are used in the route aggregation
  2504.       algorithm described in 9.2.4.2. They reduce the size of the
  2505.       AS_PATH information by listing each AS number only once,
  2506.       regardless of how many times it may have appeared in multiple
  2507.       AS_PATHs that were aggregated.
  2508.  
  2509.       An AS_SET implies that the destinations listed in the NLRI can be
  2510.       reached through paths that traverse at least some of the
  2511.       constituent autonomous systems. AS_SETs provide sufficient
  2512.       information to avoid routing information looping; however their
  2513.       use may prune potentially feasible paths, since such paths are no
  2514.       longer listed individually as in the form of AS_SEQUENCEs.  In
  2515.       practice this is not likely to be a problem, since once an IP
  2516.       packet arrives at the edge of a group of autonomous systems, the
  2517.  
  2518.  
  2519.  
  2520. Expiration Date May 1993                                       [Page 45]
  2521.  
  2522. RFC DRAFT                                                  December 1992
  2523.  
  2524.  
  2525.       BGP speaker at that point is likely to have more detailed path
  2526.       information and can distinguish individual paths to destinations.
  2527.  
  2528.  
  2529. 9.2.4.2 Aggregating Routing Information
  2530.  
  2531.  
  2532.    Aggregation is the process of combining the characteristics of
  2533.    several different routes in such a way that a single route can be
  2534.    advertised.  Aggregation can occur as part of the decision  process
  2535.    to reduce the amount of routing information that will be placed in
  2536.    the Adj-RIBs-Out.
  2537.  
  2538.    Aggregation reduces the amount of information that a BGP speaker must
  2539.    store and exchange with other BGP speakers. Routes can be aggregated
  2540.    by applying the following procedure separately to path attributes of
  2541.    like type and to the Network Layer Reachability Information.
  2542.  
  2543.    Routes that have the following attributes shall not be aggregated
  2544.    unless the corresponding attributes of each route are identical:
  2545.    MULTI_EXIT_DISC, NEXT_HOP.
  2546.  
  2547.    Path attributes that have different type codes can not be aggregated
  2548.    together. Path of the same type code may be aggregated, according to
  2549.    the following rules:
  2550.  
  2551.       ORIGIN attribute: If at least one route among routes that are
  2552.       aggregated has ORIGIN with the value INCOMPLETE, then the
  2553.       aggregated route must have the ORIGIN attribute with the value
  2554.       INCOMPLETE. Otherwise, if at least one route among routes that are
  2555.       aggregated has ORIGIN with the value EGP, then the aggregated
  2556.       route must have the origin attribute with the value EGP. In all
  2557.       other case the value of the ORIGIN attribute of the aggregated
  2558.       route is INTERNAL.
  2559.  
  2560.       AS_PATH attribute: If routes to be aggregated have identical
  2561.       AS_PATH attributes, then the aggregated route has the same AS_PATH
  2562.       attribute as each individual route.
  2563.  
  2564.       For the purpose of aggregating AS_PATH attributes we model each AS
  2565.       within the AS_PATH attribute as a tuple <type, value>, where
  2566.       "type" identifies a type of the path segment the AS belongs to
  2567.       (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number.  If the
  2568.       routes to be aggregated have different AS_PATH attributes, then
  2569.       the aggregated AS_PATH attribute shall satisfy all of the
  2570.       following conditions:
  2571.  
  2572.          - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH
  2573.  
  2574.  
  2575.  
  2576. Expiration Date May 1993                                       [Page 46]
  2577.  
  2578. RFC DRAFT                                                  December 1992
  2579.  
  2580.  
  2581.          shall appear in all of the AS_PATH in the initial set of routes
  2582.          to be aggregated.
  2583.  
  2584.          - all tuples of the type AS_SET in the aggregated AS_PATH shall
  2585.          appear in at least one of the AS_PATH in the initial set (they
  2586.          may appear as either AS_SET or AS_SEQUENCE types).
  2587.  
  2588.          - for any tuple X of the type AS_SEQUENCE in the aggregated
  2589.          AS_PATH which precedes tuple Y in the aggregated AS_PATH, X
  2590.          precedes Y in each AS_PATH in the initial set which contains Y,
  2591.          regardless of the type of Y.
  2592.  
  2593.          - No tuple with the same value shall appear more than once in
  2594.          the aggregated AS_PATH, regardless of the tuple's type.
  2595.  
  2596.       An implementation may choose any algorithm which conforms to these
  2597.       rules.  At a minimum a conformant implementation shall be able to
  2598.       perform the following algorithm that meets all of the above
  2599.       conditions:
  2600.  
  2601.          - determine the longest leading sequence of tuples (as defined
  2602.          above) common to all the AS_PATH attributes of the routes to be
  2603.          aggregated. Make this sequence the leading sequence of the
  2604.          aggregated AS_PATH attribute.
  2605.  
  2606.          - set the type of the rest of the tuples from the AS_PATH
  2607.          attributes of the routes to be aggregated to AS_SET, and append
  2608.          them to the aggregated AS_PATH attribute.
  2609.  
  2610.          - if the aggregated AS_PATH has more than one tuple with the
  2611.          same value (regardless of tuple's type), eliminate all, but one
  2612.          such tuple by deleting tuples of the type AS_SET from the
  2613.          aggregated AS_PATH attribute.
  2614.  
  2615.       Appendix 6, section 6.8 presents another algorithm that satisfies
  2616.       the conditions and  allows for more complex policy configurations.
  2617.  
  2618.       ATOMIC_AGGREGATE: If at least one of the routes to be aggregated
  2619.       has ATOMIC_AGGREGATE path attribute, then the aggregated route
  2620.       shall have this attribute as well.
  2621.  
  2622.       AGGREGATOR: All AGGREGATOR attributes of all routes to be
  2623.       aggregated should be ignored.
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632. Expiration Date May 1993                                       [Page 47]
  2633.  
  2634. RFC DRAFT                                                  December 1992
  2635.  
  2636.  
  2637. 9.3.6   Route Selection Criteria
  2638.  
  2639.  
  2640.    Generally speaking, the rules for comparing routes among several
  2641.    alternatives are outside the scope of this document.  There are two
  2642.    exceptions:
  2643.  
  2644.       - If the local AS appears in the AS path of the new route being
  2645.       considered, then that new route cannot be viewed as better than
  2646.       any other route.  If such a route were ever used, a routing loop
  2647.       would result.
  2648.  
  2649.       - In order to achieve successful distributed operation, only
  2650.       routes with a likelihood of stability can be chosen.  Thus, an AS
  2651.       must avoid using unstable routes, and it must not make rapid
  2652.       spontaneous changes to its choice of route.  Quantifying the terms
  2653.       "unstable" and "rapid" in the previous sentence will require
  2654.       experience, but the principle is clear.
  2655.  
  2656.  
  2657. Appendix 1.  BGP FSM State Transitions and Actions.
  2658.  
  2659.  
  2660.    This Appendix discusses the transitions between states in the BGP FSM
  2661.    in response to BGP events.  The following is the list of these states
  2662.    and events.
  2663.  
  2664.        BGP States:
  2665.  
  2666.                 1 - Idle
  2667.                 2 - Connect
  2668.                 3 - Active
  2669.                 4 - OpenSent
  2670.                 5 - OpenConfirm
  2671.                 6 - Established
  2672.  
  2673.  
  2674.        BGP Events:
  2675.  
  2676.                 1 - BGP Start
  2677.                 2 - BGP Stop
  2678.                 3 - BGP Transport connection open
  2679.                 4 - BGP Transport connection closed
  2680.                 5 - BGP Transport connection open failed
  2681.                 6 - BGP Transport fatal error
  2682.                 7 - ConnectRetry timer expired
  2683.                 8 - Holdtime timer expired
  2684.                 9 - KeepAlive timer expired
  2685.  
  2686.  
  2687.  
  2688. Expiration Date May 1993                                       [Page 48]
  2689.  
  2690. RFC DRAFT                                                  December 1992
  2691.  
  2692.  
  2693.                10 - Receive OPEN message
  2694.                11 - Receive KEEPALIVE message
  2695.                12 - Receive UPDATE messages
  2696.                13 - Receive NOTIFICATION message
  2697.  
  2698.    The following table describes the state transitions of the BGP FSM
  2699.    and the actions triggered by these transitions.
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.        Event                Actions               Message Sent   Next State
  2706.        --------------------------------------------------------------------
  2707.        Idle (1)
  2708.         1            Initialize resources            none             2
  2709.                      Start ConnectRetry timer
  2710.                      Initiate a transport connection
  2711.         others               none                    none             1
  2712.  
  2713.        Connect(2)
  2714.         1                    none                    none             2
  2715.         3            Complete initialization         OPEN             4
  2716.                      Clear ConnectRetry timer
  2717.         5            Restart ConnectRetry timer      none             3
  2718.         7            Restart ConnectRetry timer      none             2
  2719.                      Initiate a transport connection
  2720.         others       Release resources               none             1
  2721.  
  2722.        Active (3)
  2723.         1                    none                    none             3
  2724.         3            Complete initialization         OPEN             4
  2725.                      Clear ConnectRetry timer
  2726.         5            Close connection                                 3
  2727.                      Restart ConnectRetry timer
  2728.         7            Restart ConnectRetry timer      none             2
  2729.                      Initiate a transport connection
  2730.         others       Release resources               none             1
  2731.  
  2732.        OpenSent(4)
  2733.         1                    none                    none             4
  2734.         4            Close transport connection      none             3
  2735.                      Restart ConnectRetry timer
  2736.         6            Release resources               none             1
  2737.        10            Process OPEN is OK            KEEPALIVE          5
  2738.                      Process OPEN failed           NOTIFICATION       1
  2739.        others        Close transport connection    NOTIFICATION       1
  2740.                      Release resources
  2741.  
  2742.  
  2743.  
  2744. Expiration Date May 1993                                       [Page 49]
  2745.  
  2746. RFC DRAFT                                                  December 1992
  2747.  
  2748.  
  2749.  
  2750.        OpenConfirm (5)
  2751.         1                   none                     none             5
  2752.         4            Release resources               none             1
  2753.         6            Release resources               none             1
  2754.         9            Restart KeepAlive timer       KEEPALIVE          5
  2755.        11            Complete initialization         none             6
  2756.                      Restart Holdtime timer
  2757.        13            Close transport connection                       1
  2758.                      Release resources
  2759.        others        Close transport connection    NOTIFICATION       1
  2760.                      Release resources
  2761.  
  2762.  
  2763.  
  2764.  
  2765.        Established (6)
  2766.         1                   none                     none             6
  2767.         4            Release resources               none             1
  2768.         6            Release resources               none             1
  2769.         9            Restart KeepAlive timer       KEEPALIVE          6
  2770.        11            Restart Holdtime timer        KEEPALIVE          6
  2771.        12            Process UPDATE is OK          UPDATE             6
  2772.                      Process UPDATE failed         NOTIFICATION       1
  2773.        13            Close transport connection                       1
  2774.                      Release resources
  2775.        others        Close transport connection    NOTIFICATION       1
  2776.                      Release resources
  2777.       ---------------------------------------------------------------------
  2778.  
  2779.  
  2780.       The following is a condensed version of the above state transition
  2781.       table.
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.    Events| Idle | Active | Connect | OpenSent | OpenConfirm | Estab
  2788.          | (1)  |   (2)  |  (3)    |    (4)   |     (5)     |   (6)
  2789.          |--------------------------------------------------------------
  2790.     1    |  2   |    2   |   3     |     4    |      5      |    6
  2791.          |      |        |         |          |             |
  2792.     2    |  1   |    1   |   1     |     1    |      1      |    1
  2793.          |      |        |         |          |             |
  2794.     3    |  1   |    4   |   4     |     1    |      1      |    1
  2795.          |      |        |         |          |             |
  2796.     4    |  1   |    1   |   1     |     3    |      1      |    1
  2797.  
  2798.  
  2799.  
  2800. Expiration Date May 1993                                       [Page 50]
  2801.  
  2802. RFC DRAFT                                                  December 1992
  2803.  
  2804.  
  2805.          |      |        |         |          |             |
  2806.     5    |  1   |    3   |   3     |     1    |      1      |    1
  2807.          |      |        |         |          |             |
  2808.     6    |  1   |    1   |   1     |     1    |      1      |    1
  2809.          |      |        |         |          |             |
  2810.     7    |  1   |    2   |   2     |     1    |      1      |    1
  2811.          |      |        |         |          |             |
  2812.     8    |  1   |    1   |   1     |     1    |      1      |    1
  2813.          |      |        |         |          |             |
  2814.     9    |  1   |    1   |   1     |     1    |      5      |    6
  2815.          |      |        |         |          |             |
  2816.    10    |  1   |    1   |   1     |  1 or 5  |      1      |    1
  2817.          |      |        |         |          |             |
  2818.    11    |  1   |    1   |   1     |     1    |      6      |    6
  2819.          |      |        |         |          |             |
  2820.    12    |  1   |    1   |   1     |     1    |      1      | 1 or 6
  2821.          |      |        |         |          |             |
  2822.    13    |  1   |    1   |   1     |     1    |      1      |    1
  2823.          |      |        |         |          |             |
  2824.          ---------------------------------------------------------------
  2825.  
  2826.  
  2827.  
  2828.  
  2829. Appendix 2. Comparison with RFC1267
  2830.  
  2831.  
  2832.    BGP-4 is capable of operating in an environment where a set of
  2833.    reachable destinations may be expressed via a single IP prefix.  The
  2834.    concept of network classes, or subnetting is foreign to BGP-4.  To
  2835.    accommodate these capabilities BGP-4 changes semantics and encoding
  2836.    associated with the AS_PATH attribute. New text has been added to
  2837.    define semantics associated with IP prefixes.  These abilities allow
  2838.    BGP-4 to support the proposed supernetting scheme [9].
  2839.  
  2840.    To simplify configuration this version introduces a new attribute,
  2841.    LOCAL_PREF, that facilitates route selection procedures.
  2842.  
  2843.    The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC.
  2844.    A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that
  2845.    certain aggregates are not de-aggregated.  Another new attribute,
  2846.    AGGREGATOR, can be added to aggregate routes in order to advertise
  2847.    which AS caused the aggregation.
  2848.  
  2849. Appendix 3.  Comparison with RFC 1163
  2850.  
  2851.  
  2852.    All of the changes listed in Appendix 2, plus the following.
  2853.  
  2854.  
  2855.  
  2856. Expiration Date May 1993                                       [Page 51]
  2857.  
  2858. RFC DRAFT                                                  December 1992
  2859.  
  2860.  
  2861.    To detect and recover from BGP connection collision, a new field (BGP
  2862.    Identifier) has been added to the OPEN message. New text (Section
  2863.    6.8) has been added to specify the procedure for detecting and
  2864.    recovering from collision.
  2865.  
  2866.    The new document no longer restricts the border router that is passed
  2867.    in the NEXT_HOP path attribute to be part of the same Autonomous
  2868.    System as the BGP Speaker.
  2869.  
  2870.    New document optimizes and simplifies the exchange of the information
  2871.    about previously reachable routes.
  2872.  
  2873.  
  2874. Appendix 4.  Comparison with RFC 1105
  2875.  
  2876.  
  2877.    All of the changes listed in Appendices 2 and 3, plus the following.
  2878.  
  2879.    Minor changes to the RFC1105 Finite State Machine were necessary to
  2880.    accommodate the TCP user interface provided by 4.3 BSD.
  2881.  
  2882.    The notion of Up/Down/Horizontal relations present in RFC1105 has
  2883.    been removed from the protocol.
  2884.  
  2885.    The changes in the message format from RFC1105 are as follows:
  2886.  
  2887.       1.  The Hold Time field has been removed from the BGP header and
  2888.       added to the OPEN message.
  2889.  
  2890.       2.  The version field has been removed from the BGP header and
  2891.       added to the OPEN message.
  2892.  
  2893.       3.  The Link Type field has been removed from the OPEN message.
  2894.  
  2895.       4.  The OPEN CONFIRM message has been eliminated and replaced with
  2896.       implicit confirmation provided by the KEEPALIVE message.
  2897.  
  2898.       5.  The format of the UPDATE message has been changed
  2899.       significantly.  New fields were added to the UPDATE message to
  2900.       support multiple path attributes.
  2901.  
  2902.       6.  The Marker field has been expanded and its role broadened to
  2903.       support authentication.
  2904.  
  2905.       Note that quite often BGP, as specified in RFC 1105, is referred
  2906.       to as BGP-1, BGP, as specified in RFC 1163, is referred to as
  2907.       BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and
  2908.       BGP, as specified in this document is referred to as BGP-4.
  2909.  
  2910.  
  2911.  
  2912. Expiration Date May 1993                                       [Page 52]
  2913.  
  2914. RFC DRAFT                                                  December 1992
  2915.  
  2916.  
  2917. Appendix 5.  TCP options that may be used with BGP
  2918.  
  2919.  
  2920.    If a local system TCP user interface supports TCP PUSH function, then
  2921.    each BGP message should be transmitted with PUSH flag set.  Setting
  2922.    PUSH flag forces BGP messages to be transmitted promptly to the
  2923.    receiver.
  2924.  
  2925.    If a local system TCP user interface supports setting precedence for
  2926.    TCP connection, then the BGP transport connection should be opened
  2927.    with precedence set to Internetwork Control (110) value (see also
  2928.    [6]).
  2929.  
  2930.  
  2931.  
  2932. Appendix 6.  Implementation Recommendations
  2933.  
  2934.  
  2935.       This section presents some implementation recommendations.
  2936.  
  2937.  
  2938. 6.1 Multiple Networks Per Message
  2939.  
  2940.  
  2941.    The BGP protocol allows for multiple networks with the same AS path
  2942.    and next-hop gateway to be specified in one message. Making use of
  2943.    this capability is highly recommended. With one network per message
  2944.    there is a substantial increase in overhead in the receiver. Not only
  2945.    does the system overhead increase due to the reception of multiple
  2946.    messages, but the overhead of scanning the routing table for updates
  2947.    to BGP peers and other routing protocols (and sending the associated
  2948.    messages) is incurred multiple times as well. One method of building
  2949.    messages containing many networks per AS path and gateway from a
  2950.    routing table that is not organized per AS path is to build many
  2951.    messages as the routing table is scanned. As each network is
  2952.    processed, a message for the associated AS path and gateway is
  2953.    allocated, if it does not exist, and the new network is added to it.
  2954.    If such a message exists, the new network is just appended to it. If
  2955.    the message lacks the space to hold the new network, it is
  2956.    transmitted, a new message is allocated, and the new network is
  2957.    inserted into the new message. When the entire routing table has been
  2958.    scanned, all allocated messages are sent and their resources
  2959.    released.  Maximum compression is achieved when all networks share a
  2960.    gateway and common path attributes, making it possible to send many
  2961.    networks in one 4096-byte message.
  2962.  
  2963.    When peering with a BGP implementation that does not compress
  2964.    multiple networks into one message, it may be necessary to take steps
  2965.  
  2966.  
  2967.  
  2968. Expiration Date May 1993                                       [Page 53]
  2969.  
  2970. RFC DRAFT                                                  December 1992
  2971.  
  2972.  
  2973.    to reduce the overhead from the flood of data received when a peer is
  2974.    acquired or a significant network topology change occurs. One method
  2975.    of doing this is to limit the rate of updates. This will eliminate
  2976.    the redundant scanning of the routing table to provide flash updates
  2977.    for BGP peers and other routing protocols. A disadvantage of this
  2978.    approach is that it increases the propagation latency of routing
  2979.    information.  By choosing a minimum flash update interval that is not
  2980.    much greater than the time it takes to process the multiple messages
  2981.    this latency should be minimized. A better method would be to read
  2982.    all received messages before sending updates.
  2983.  
  2984.  
  2985. 6.2  Processing Messages on a Stream Protocol
  2986.  
  2987.  
  2988.    BGP uses TCP as a transport mechanism.  Due to the stream nature of
  2989.    TCP, all the data for received messages does not necessarily arrive
  2990.    at the same time. This can make it difficult to process the data as
  2991.    messages, especially on systems such as BSD Unix where it is not
  2992.    possible to determine how much data has been received but not yet
  2993.    processed.
  2994.  
  2995.    One method that can be used in this situation is to first try to read
  2996.    just the message header. For the KEEPALIVE message type, this is a
  2997.    complete message; for other message types, the header should first be
  2998.    verified, in particular the total length. If all checks are
  2999.    successful, the specified length, minus the size of the message
  3000.    header is the amount of data left to read. An implementation that
  3001.    would "hang" the routing information process while trying to read
  3002.    from a peer could set up a message buffer (4096 bytes) per peer and
  3003.    fill it with data as available until a complete message has been
  3004.    received.
  3005.  
  3006.  
  3007. 6.3 Reducing route flapping
  3008.  
  3009.  
  3010.    To avoid excessive route flapping a BGP speaker which needs to
  3011.    withdraw a destination and send an update about a more specific or
  3012.    less specific route shall combine them into the same UPDATE message.
  3013.  
  3014.  
  3015. 6.4 BGP Timers
  3016.  
  3017.  
  3018.    BGP employs five timers: ConnectRetry, Holdtime, KeepAlive,
  3019.    MinRouteOriginationInterval, and MinRouteAdvertisementInterval
  3020.    Suggested value for the ConnectRetry timer is 120 seconds.  Suggested
  3021.  
  3022.  
  3023.  
  3024. Expiration Date May 1993                                       [Page 54]
  3025.  
  3026. RFC DRAFT                                                  December 1992
  3027.  
  3028.  
  3029.    value for the Holdtime timer is 90 seconds.  Suggested value for the
  3030.    KeepAlive timer is 30 seconds.  Suggested value for the
  3031.    MinRouteOriginationInterval is 15 minutes.  Suggested value for the
  3032.    MinRouteAdvertisementInterval is 30 seconds.
  3033.  
  3034.    An implementation of BGP shall allow any of these timers to be
  3035.    configurable.
  3036.  
  3037.  
  3038. 6.5 Path attribute ordering
  3039.  
  3040.  
  3041.    Implementations which combine update messages as described above in
  3042.    6.1 may prefer to see all path attributes presented in a known order.
  3043.    This permits them to quickly identify sets of attributes from
  3044.    different update messages which are semantically identical.  To
  3045.    facilitate this, it is a useful optimization to order the path
  3046.    attributes according to type code.  This optimization is entirely
  3047.    optional.
  3048.  
  3049.  
  3050. 6.6 AS_SET sorting
  3051.  
  3052.  
  3053.    Another useful optimization that can be done to simplify this
  3054.    situation is to sort the AS numbers found in an AS_SET.  This
  3055.    optimization is entirely optional.
  3056.  
  3057.  
  3058. 6.7 Control over version negotiation
  3059.  
  3060.  
  3061.    Since BGP-4 is capable of carrying aggregated routes which cannot be
  3062.    properly represented in BGP-3, an implementation which supports BGP-4
  3063.    and another BGP version should provide the capability to only speak
  3064.    BGP-4 on a per-neighbor basis.
  3065.  
  3066.  
  3067. 6.8 Complex AS_PATH aggregation
  3068.  
  3069.  
  3070.    An implementation which chooses to provide a path aggregation
  3071.    algorithm which retains significant amounts of path information may
  3072.    wish to use the following procedure:
  3073.  
  3074.       For the purpose of aggregating AS_PATH attributes of two routes,
  3075.       we model each AS as a tuple <type, value>, where "type" identifies
  3076.       a type of the path segment the AS belongs to (e.g.  AS_SEQUENCE,
  3077.  
  3078.  
  3079.  
  3080. Expiration Date May 1993                                       [Page 55]
  3081.  
  3082. RFC DRAFT                                                  December 1992
  3083.  
  3084.  
  3085.       AS_SET), and "value" is the AS number.  Two ASs are said to be the
  3086.       same if their corresponding <type, value> tuples are the same.
  3087.  
  3088.       The algorithm to aggregate two AS_PATH attributes works as
  3089.       follows:
  3090.  
  3091.          a) Identify the same ASs (as defined above) within each AS_PATH
  3092.          attribute that are in the same relative order within both
  3093.          AS_PATH attributes.  Two ASs, X and Y, are said to be in the
  3094.          same order if either:
  3095.             - X precedes Y in both AS_PATH attributes, or - Y precedes X
  3096.             in both AS_PATH attributes.
  3097.  
  3098.          b) The aggregated AS_PATH attribute consists of ASs identified
  3099.          in (a) in exactly the same order as they appear in the AS_PATH
  3100.          attributes to be aggregated. If two consecutive ASs identified
  3101.          in (a) do not immediately follow each other in both of the
  3102.          AS_PATH attributes to be aggregated, then the intervening ASs
  3103.          (ASs that are between the two consecutive ASs that are the
  3104.          same) in both attributes are combined into an AS_SET path
  3105.          segment that consists of the intervening ASs from both AS_PATH
  3106.          attributes; this segment is then placed in between the two
  3107.          consecutive ASs identified in (a) of the aggregated attribute.
  3108.          If two consecutive ASs identified in (a) immediately follow
  3109.          each other in one attribute, but do not follow in another, then
  3110.          the intervening ASs of the latter are combined into an AS_SET
  3111.          path segment; this segment is then placed in between the two
  3112.          consecutive ASs identified in (a) of the aggregated attribute.
  3113.  
  3114.  
  3115.       If as a result of the above procedure a given AS number appears
  3116.       more than once within the aggregated AS_PATH attribute, all, but
  3117.       the last instance (rightmost occurrence) of that AS number should
  3118.       be removed from the aggregated AS_PATH attribute.
  3119.  
  3120. References
  3121.  
  3122.  
  3123.    [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC
  3124.    904, BBN, April 1984.
  3125.  
  3126.    [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET
  3127.    Backbone", RFC 1092, T.J. Watson Research Center, February 1989.
  3128.  
  3129.    [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093,
  3130.    MERIT/NSFNET Project, February 1989.
  3131.  
  3132.    [4] Postel, J., "Transmission Control Protocol - DARPA Internet
  3133.  
  3134.  
  3135.  
  3136. Expiration Date May 1993                                       [Page 56]
  3137.  
  3138. RFC DRAFT                                                  December 1992
  3139.  
  3140.  
  3141.    Program Protocol Specification", RFC 793, DARPA, September 1981.
  3142.  
  3143.    [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway
  3144.    Protocol in the Internet", RFC 1268, T.J. Watson Research Center, IBM
  3145.    Corp., ANS, October 1991.
  3146.  
  3147.    [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol
  3148.    Specification", RFC 791, DARPA, September 1981.
  3149.  
  3150.    [7] "Information Processing Systems - Telecommunications and
  3151.    Information Exchange between Systems - Protocol for Exchange of
  3152.    Inter-domain Routeing Information among Intermediate Systems to
  3153.    Support Forwarding of ISO 8473 PDUs", ISO/IEC JTC 1/SC 6 N7196, March
  3154.    1992.
  3155.  
  3156.    [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., "Supernetting: an
  3157.    Address Assignment and Aggregation Strategy", Internet Draft, 1992.
  3158.  
  3159.  
  3160. Security Considerations
  3161.  
  3162.    Security issues are not discussed in this memo.
  3163.  
  3164.  
  3165. Editors' Addresses
  3166.  
  3167.    Yakov Rekhter
  3168.    T.J. Watson Research Center IBM Corporation
  3169.    P.O. Box 218
  3170.    Yorktown Heights, NY 10598
  3171.    Phone:  (914) 945-3896
  3172.    email:  yakov@watson.ibm.com
  3173.  
  3174.    Tony Li
  3175.    cisco Systems, Inc.
  3176.    1525 O'Brien Drive
  3177.    Menlo Park, CA 94025
  3178.    email: tli@cisco.com
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192. Expiration Date May 1993                                       [Page 57]
  3193.  
  3194.